@@ -98,11 +98,11 @@ export class LspController {
98
98
}
99
99
100
100
async buildIndex ( buildIndexConfig : BuildIndexConfig ) {
101
- this . logger . info ( `LspController: Starting to build index of project` )
101
+ this . logger . info ( `Starting to build index of project` )
102
102
const start = performance . now ( )
103
103
const projPaths = ( vscode . workspace . workspaceFolders ?? [ ] ) . map ( ( folder ) => folder . uri . fsPath )
104
104
if ( projPaths . length === 0 ) {
105
- this . logger . info ( `LspController: Skipping building index. No projects found in workspace` )
105
+ this . logger . info ( `Skipping building index. No projects found in workspace` )
106
106
return
107
107
}
108
108
projPaths . sort ( )
@@ -119,12 +119,12 @@ export class LspController {
119
119
( accumulator , currentFile ) => accumulator + currentFile . fileSizeBytes ,
120
120
0
121
121
)
122
- this . logger . info ( `LspController: Found ${ files . length } files in current project ${ projPaths } ` )
122
+ this . logger . info ( `Found ${ files . length } files in current project ${ projPaths } ` )
123
123
const config = buildIndexConfig . isVectorIndexEnabled ? 'all' : 'default'
124
124
const r = files . map ( ( f ) => f . fileUri . fsPath )
125
125
const resp = await LspClient . instance . buildIndex ( r , projRoot , config )
126
126
if ( resp ) {
127
- this . logger . debug ( `LspController: Finish building index of project` )
127
+ this . logger . debug ( `Finish building index of project` )
128
128
const usage = await LspClient . instance . getLspServerUsage ( )
129
129
telemetry . amazonq_indexWorkspace . emit ( {
130
130
duration : performance . now ( ) - start ,
@@ -137,7 +137,7 @@ export class LspController {
137
137
credentialStartUrl : buildIndexConfig . startUrl ,
138
138
} )
139
139
} else {
140
- this . logger . error ( `LspController: Failed to build index of project` )
140
+ this . logger . error ( `Failed to build index of project` )
141
141
telemetry . amazonq_indexWorkspace . emit ( {
142
142
duration : performance . now ( ) - start ,
143
143
result : 'Failed' ,
@@ -149,7 +149,7 @@ export class LspController {
149
149
}
150
150
} catch ( error ) {
151
151
// TODO: use telemetry.run()
152
- this . logger . error ( `LspController: Failed to build index of project` )
152
+ this . logger . error ( `Failed to build index of project` )
153
153
telemetry . amazonq_indexWorkspace . emit ( {
154
154
duration : performance . now ( ) - start ,
155
155
result : 'Failed' ,
@@ -166,7 +166,7 @@ export class LspController {
166
166
167
167
async trySetupLsp ( context : vscode . ExtensionContext , buildIndexConfig : BuildIndexConfig ) {
168
168
if ( isCloud9 ( ) || isWeb ( ) || isAmazonInternalOs ( ) ) {
169
- this . logger . warn ( 'LspController: Skipping LSP setup. LSP is not compatible with the current environment. ' )
169
+ this . logger . warn ( 'Skipping LSP setup. LSP is not compatible with the current environment. ' )
170
170
// do not do anything if in Cloud9 or Web mode or in AL2 (AL2 does not support node v18+)
171
171
return
172
172
}
@@ -181,7 +181,7 @@ export class LspController {
181
181
const usage = await LspClient . instance . getLspServerUsage ( )
182
182
if ( usage ) {
183
183
this . logger . info (
184
- `LspController: LSP server CPU ${ usage . cpuUsage } %, LSP server Memory ${
184
+ `LSP server CPU ${ usage . cpuUsage } %, LSP server Memory ${
185
185
usage . memoryUsage / ( 1024 * 1024 )
186
186
} MB `
187
187
)
@@ -190,7 +190,7 @@ export class LspController {
190
190
30 * 60 * 1000
191
191
)
192
192
} catch ( e ) {
193
- this . logger . error ( `LspController: LSP failed to activate ${ e } ` )
193
+ this . logger . error ( `LSP failed to activate ${ e } ` )
194
194
}
195
195
} )
196
196
}
@@ -207,7 +207,7 @@ export class LspController {
207
207
return
208
208
}
209
209
this . _contextCommandSymbolsUpdated = true
210
- getLogger ( ) . debug ( `LspController: Start adding symbols to context picker menu` )
210
+ getLogger ( ) . debug ( `Start adding symbols to context picker menu` )
211
211
try {
212
212
const indexSeqNum = await LspClient . instance . getIndexSequenceNumber ( )
213
213
await LspClient . instance . updateIndex ( [ ] , 'context_command_symbol_update' )
@@ -223,15 +223,15 @@ export class LspController {
223
223
{ interval : 1000 , timeout : 60_000 , truthy : true }
224
224
)
225
225
} catch ( err ) {
226
- getLogger ( ) . error ( `LspController: Failed to find symbols` )
226
+ this . logger . error ( `Failed to find symbols` )
227
227
}
228
228
}
229
229
230
230
private async setupLsp ( context : vscode . ExtensionContext ) {
231
231
await lspSetupStage ( 'all' , async ( ) => {
232
232
const installResult = await new WorkspaceLspInstaller ( ) . resolve ( )
233
233
await lspSetupStage ( 'launch' , async ( ) => activateLsp ( context , installResult . resourcePaths ) )
234
- this . logger . info ( 'LspController: LSP activated' )
234
+ this . logger . info ( 'LSP activated' )
235
235
} )
236
236
}
237
237
}
0 commit comments