From bdb967d7b3c18fa2e0237f3cc0e0ea7415102715 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Mon, 12 Aug 2024 14:54:51 -0700 Subject: [PATCH 1/2] fix: `REPLACE INTO` code_snippet table --- core/indexing/CodeSnippetsIndex.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/indexing/CodeSnippetsIndex.ts b/core/indexing/CodeSnippetsIndex.ts index 8fc1ccb95..e431dfdf8 100644 --- a/core/indexing/CodeSnippetsIndex.ts +++ b/core/indexing/CodeSnippetsIndex.ts @@ -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, @@ -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], ); } From e45d55d58d3c2788e51b277fe54b91bd74d51eed Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Mon, 12 Aug 2024 15:00:45 -0700 Subject: [PATCH 2/2] Update index.ts --- gui/src/redux/selectors/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/src/redux/selectors/index.ts b/gui/src/redux/selectors/index.ts index f41ad42ff..88f5c99bc 100644 --- a/gui/src/redux/selectors/index.ts +++ b/gui/src/redux/selectors/index.ts @@ -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), );