Skip to content

Commit d2df343

Browse files
committed
further clean up
1 parent eddce96 commit d2df343

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/core/src/codewhisperer/util/supplementalContext/crossFileContextUtil.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ export async function fetchSupplementalContextForSrc(
6767
if (false) {
6868
return fetchSupplementalContextForSrcV1(editor, cancellationToken)
6969
} else {
70-
return fetchSupplementalContextForSrcV2(editor)
70+
try {
71+
return fetchSupplementalContextForSrcV2(editor)
72+
} catch (e) {
73+
getLogger().error(`Failed to fetch supplemental context from LSP ${e}`)
74+
return fetchSupplementalContextForSrcV1(editor, cancellationToken)
75+
}
7176
}
7277
}
7378

@@ -76,9 +81,9 @@ export async function fetchSupplementalContextForSrcV2(
7681
): Promise<Pick<CodeWhispererSupplementalContext, 'supplementalContextItems' | 'strategy'> | undefined> {
7782
const inputChunkContent = getInputChunk(editor)
7883

79-
const bm25Response: { content: string; score: number; filePath: string }[] =
84+
const inlineProjectContext: { content: string; score: number; filePath: string }[] =
8085
await LspController.instance.queryInlineProjectContext(inputChunkContent.content, editor.document.uri.fsPath)
81-
getLogger().info(JSON.stringify(bm25Response))
86+
getLogger().info(JSON.stringify(inlineProjectContext))
8287

8388
const supContextItems: CodeWhispererSupplementalContextItem[] = []
8489
return {

0 commit comments

Comments
 (0)