File tree Expand file tree Collapse file tree 2 files changed +6
-27
lines changed
packages/core/src/amazonq/lsp Expand file tree Collapse file tree 2 files changed +6
-27
lines changed Original file line number Diff line number Diff line change @@ -103,39 +103,15 @@ export class LspClient {
103103 }
104104 }
105105
106- async queryInlineProjectContext ( query : string , path : string ) {
106+ async queryInlineProjectContext ( query : string , path : string , target : 'default' | 'codemap' | 'bm25' ) {
107107 try {
108- getLogger ( ) . info ( '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' )
109108 const request = JSON . stringify ( {
110109 query : query ,
111110 filePath : path ,
112- target : 'default' ,
111+ target,
113112 } )
114-
115- const repomapRequest = await this . encrypt (
116- JSON . stringify ( {
117- query : query ,
118- filePath : path ,
119- target : 'codemap' ,
120- } )
121- )
122-
123- const bm25Request = await this . encrypt (
124- JSON . stringify ( {
125- query : query ,
126- filePath : path ,
127- target : 'bm25' ,
128- } )
129- )
130-
131- const repomapResponse = await this . client ?. sendRequest ( QueryInlineProjectContextRequestType , repomapRequest )
132- getLogger ( ) . info ( `repomap: ${ JSON . stringify ( repomapResponse ) } ` )
133- const bm25Response = await this . client ?. sendRequest ( QueryInlineProjectContextRequestType , bm25Request )
134- getLogger ( ) . info ( `bm25: ${ JSON . stringify ( bm25Response ) } ` )
135-
136113 const encrypted = await this . encrypt ( request )
137114 const resp : any = await this . client ?. sendRequest ( QueryInlineProjectContextRequestType , encrypted )
138- getLogger ( ) . info ( `ALL: ${ JSON . stringify ( resp ) } ` )
139115 return resp
140116 } catch ( e ) {
141117 getLogger ( ) . error ( `LspClient: queryInlineProjectContext error: ${ e } ` )
Original file line number Diff line number Diff line change @@ -310,8 +310,11 @@ export class LspController {
310310
311311 async queryInlineProjectContext ( query : string , path : string , target : 'bm25' | 'codemap' | 'default' ) {
312312 try {
313- return await LspClient . instance . queryInlineProjectContext ( query , path )
313+ return await LspClient . instance . queryInlineProjectContext ( query , path , target )
314314 } catch ( e ) {
315+ if ( e instanceof Error ) {
316+ getLogger ( ) . error ( `unexpected error while querying inline project context, e=${ e . message } ` )
317+ }
315318 return [ ]
316319 }
317320 }
You can’t perform that action at this time.
0 commit comments