From 633d3af9be4c1fbb677702c29e1e393be7715065 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 15 Apr 2024 14:09:33 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20temporarily=20remove=20problemat?= =?UTF-8?q?ic=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