File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
packages/core/src/codewhisperer/util/supplementalContext Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments