From 74504519d6b824c47014fc9df21c830a9e1513eb Mon Sep 17 00:00:00 2001 From: SR_team Date: Mon, 15 Apr 2024 23:45:01 +0300 Subject: [PATCH 1/3] Adds additional ignores for C-fmilies langs (#1129) Ignored: - cache directory `.cache`, used by clangd - dependency files `*o.d`, used by object files - LLVM and GNU coverage files: `*.profraw`, `*.gcda` and `*.gcno` --- core/indexing/ignore.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/indexing/ignore.ts b/core/indexing/ignore.ts index c0776b3bf..ac8d38dec 100644 --- a/core/indexing/ignore.ts +++ b/core/indexing/ignore.ts @@ -25,6 +25,7 @@ const DEFAULT_IGNORE_FILETYPES = [ "*.dll", "*.obj", "*.o", + "*.o.d", "*.a", "*.lib", "*.so", @@ -54,6 +55,9 @@ const DEFAULT_IGNORE_FILETYPES = [ "*.sqlite", "*.wasm", "*.plist", + "*.profraw", + "*.gcda", + "*.gcno", ]; export const defaultIgnoreFile = ignore().add(DEFAULT_IGNORE_FILETYPES); export const DEFAULT_IGNORE_DIRS = [ @@ -76,5 +80,6 @@ export const DEFAULT_IGNORE_DIRS = [ ".continue", "__pycache__", "site-packages", + ".cache", ]; export const defaultIgnoreDir = ignore().add(DEFAULT_IGNORE_DIRS); From 633d3af9be4c1fbb677702c29e1e393be7715065 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 15 Apr 2024 14:09:33 -0700 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=94=A5=20temporarily=20remove=20probl?= =?UTF-8?q?ematic=20expandSnippet=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/context/retrieval/retrieval.ts | 38 +++++++++++++++-------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/core/context/retrieval/retrieval.ts b/core/context/retrieval/retrieval.ts index 63ed4a70d..9527aaa83 100644 --- a/core/context/retrieval/retrieval.ts +++ b/core/context/retrieval/retrieval.ts @@ -66,24 +66,26 @@ export async function retrieveContextItemsFromEmbeddings( // Source: expansion with code graph // consider doing this after reranking? Or just having a lower reranking threshold // This is VS Code only until we use PSI for JetBrains or build our own general solution - if ((await extras.ide.getIdeInfo()).ideType === "vscode") { - const { expandSnippet } = await import( - "../../../extensions/vscode/src/util/expandSnippet" - ); - let expansionResults = ( - await Promise.all( - extras.selectedCode.map(async (rif) => { - return expandSnippet( - rif.filepath, - rif.range.start.line, - rif.range.end.line, - extras.ide, - ); - }), - ) - ).flat() as Chunk[]; - retrievalResults.push(...expansionResults); - } + // TODO: Need to pass in the expandSnippet function as a function argument + // because this import causes `tsc` to fail + // if ((await extras.ide.getIdeInfo()).ideType === "vscode") { + // const { expandSnippet } = await import( + // "../../../extensions/vscode/src/util/expandSnippet" + // ); + // let expansionResults = ( + // await Promise.all( + // extras.selectedCode.map(async (rif) => { + // return expandSnippet( + // rif.filepath, + // rif.range.start.line, + // rif.range.end.line, + // extras.ide, + // ); + // }), + // ) + // ).flat() as Chunk[]; + // retrievalResults.push(...expansionResults); + // } // Source: Open file exact match // Source: Class/function name exact match From 7ac45d38f49a403ab0b02bbfe5246646132e8c7c Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 15 Apr 2024 14:17:38 -0700 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=91=B7=20add=20npx=20to=20prefix=20vs?= =?UTF-8?q?ce=20in=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/vscode/scripts/package.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/vscode/scripts/package.js b/extensions/vscode/scripts/package.js index e5b376fac..615ee8bbb 100644 --- a/extensions/vscode/scripts/package.js +++ b/extensions/vscode/scripts/package.js @@ -9,8 +9,8 @@ if (!fs.existsSync("build")) { } const command = isPreRelease - ? "vsce package --out ./build patch --pre-release" // --yarn" - : "vsce package --out ./build patch"; // --yarn"; + ? "npx vsce package --out ./build patch --pre-release" // --yarn" + : "npx vsce package --out ./build patch"; // --yarn"; exec(command, (error) => { if (error) throw error;