@@ -72,21 +72,7 @@ export async function fetchSupplementalContextForSrc(
72
72
if ( supplementalContextConfig === undefined ) {
73
73
return supplementalContextConfig
74
74
}
75
-
76
- if ( supplementalContextConfig === 'OpenTabs_BM25' ) {
77
- const opentabsContextPromise = waitUntil (
78
- async function ( ) {
79
- return await fetchOpenTabsContext ( document , position , workspace , cancellationToken )
80
- } ,
81
- { timeout : supplementalContextTimeoutInMs , interval : 5 , truthy : false }
82
- )
83
- const supContext = ( await opentabsContextPromise ) ?? [ ]
84
- return {
85
- supplementalContextItems : supContext ,
86
- strategy : supContext . length === 0 ? 'Empty' : 'OpenTabs_BM25' ,
87
- }
88
- }
89
-
75
+ //TODO: add logic for other strategies once available
90
76
if ( supplementalContextConfig === 'codemap' ) {
91
77
return await codemapContext ( document , position , workspace , cancellationToken )
92
78
}
@@ -151,13 +137,18 @@ export async function fetchProjectContext(
151
137
) : Promise < CodeWhispererSupplementalContextItem [ ] > {
152
138
const inputChunk : Chunk = getInputChunk ( document , position , crossFileContextConfig . numberOfLinesEachChunk )
153
139
const fsPath = URI . parse ( document . uri ) . fsPath
140
+ let controller : LocalProjectContextController
154
141
const inlineProjectContextRequest : QueryInlineProjectContextRequestV2 = {
155
142
query : inputChunk . content ,
156
143
filePath : fsPath ,
157
144
target,
158
145
}
159
146
160
- const controller = LocalProjectContextController . getInstance ( )
147
+ try {
148
+ controller = LocalProjectContextController . getInstance ( )
149
+ } catch ( e ) {
150
+ return [ ]
151
+ }
161
152
return controller . queryInlineProjectContext ( inlineProjectContextRequest )
162
153
}
163
154
0 commit comments