@@ -22,7 +22,6 @@ import {
2222 BuildIndexRequestType ,
2323 GetUsageRequestType ,
2424 IndexConfig ,
25- IndexRequestType ,
2625 QueryInlineProjectContextRequestType ,
2726 QueryRequestType ,
2827 UpdateIndexV2RequestPayload ,
@@ -72,24 +71,7 @@ export class LspClient {
7271 . encrypt ( key )
7372 }
7473
75- async indexFiles ( request : string [ ] , rootPath : string , refresh : boolean ) {
76- try {
77- const encryptedRequest = await this . encrypt (
78- JSON . stringify ( {
79- filePaths : request ,
80- rootPath : rootPath ,
81- refresh : refresh ,
82- } )
83- )
84- const resp = await this . client ?. sendRequest ( IndexRequestType , encryptedRequest )
85- return resp
86- } catch ( e ) {
87- getLogger ( ) . error ( `LspClient: indexFiles error: ${ e } ` )
88- return undefined
89- }
90- }
91-
92- async indexFilesV2 ( paths : string [ ] , rootPath : string , config : IndexConfig ) {
74+ async indexFiles ( paths : string [ ] , rootPath : string , config : IndexConfig ) {
9375 const payload : BuildIndexRequestPayload = {
9476 filePaths : paths ,
9577 projectRoot : rootPath ,
@@ -144,9 +126,7 @@ export class LspClient {
144126 }
145127 }
146128
147- // not yet account for file move
148- // v2
149- async updateIndexV2 ( filePath : string [ ] , mode : 'update' | 'remove' | 'add' ) {
129+ async updateIndex ( filePath : string [ ] , mode : 'update' | 'remove' | 'add' ) {
150130 const payload : UpdateIndexV2RequestPayload = {
151131 filePaths : filePath ,
152132 updateMode : mode ,
@@ -247,17 +227,17 @@ export async function activate(extensionContext: ExtensionContext) {
247227 } ) ,
248228 vscode . window . onDidChangeActiveTextEditor ( ( editor ) => {
249229 if ( savedDocument && editor && editor . document . uri . fsPath !== savedDocument . fsPath ) {
250- void LspClient . instance . updateIndexV2 ( [ editor . document . uri . fsPath ] , 'update' )
230+ void LspClient . instance . updateIndex ( [ editor . document . uri . fsPath ] , 'update' )
251231 }
252232 } ) ,
253233 vscode . workspace . onDidCreateFiles ( ( e ) => {
254- void LspClient . instance . updateIndexV2 (
234+ void LspClient . instance . updateIndex (
255235 e . files . map ( ( f ) => f . fsPath ) ,
256236 'add'
257237 )
258238 } ) ,
259239 vscode . workspace . onDidDeleteFiles ( ( e ) => {
260- void LspClient . instance . updateIndexV2 (
240+ void LspClient . instance . updateIndex (
261241 e . files . map ( ( f ) => f . fsPath ) ,
262242 'remove'
263243 )
0 commit comments