Skip to content

Commit

Permalink
Merge pull request #1992 from continuedev/pe/code-snippet-index-issues
Browse files Browse the repository at this point in the history
fix: `REPLACE INTO` code_snippet table
  • Loading branch information
Patrick-Erichsen authored Aug 12, 2024
2 parents e61c2e9 + e45d55d commit bf918ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/indexing/CodeSnippetsIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class CodeSnippetsCodebaseIndex implements CodebaseIndex {

for (const snippet of snippets) {
const { lastID } = await db.run(
"INSERT INTO code_snippets (path, cacheKey, content, title, startLine, endLine) VALUES (?, ?, ?, ?, ?, ?)",
"REPLACE INTO code_snippets (path, cacheKey, content, title, startLine, endLine) VALUES (?, ?, ?, ?, ?, ?)",
[
addTag.path,
addTag.cacheKey,
Expand All @@ -212,7 +212,7 @@ export class CodeSnippetsCodebaseIndex implements CodebaseIndex {
],
);
await db.run(
"INSERT INTO code_snippets_tags (snippetId, tag) VALUES (?, ?)",
"REPLACE INTO code_snippets_tags (snippetId, tag) VALUES (?, ?)",
[lastID, tagString],
);
}
Expand Down
2 changes: 1 addition & 1 deletion gui/src/redux/selectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ export const selectContextProviderDescriptions = createSelector(

export const selectUseActiveFile = createSelector(
[(store: RootState) => store.state.config.experimental?.defaultContext],
(defaultContext) => defaultContext?.includes("activeFile"),
(defaultContext) => defaultContext?.includes("activeFile" as any),
);

0 comments on commit bf918ec

Please sign in to comment.