Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Feature",
"description": "Start language server by default"
}
18 changes: 7 additions & 11 deletions packages/core/src/amazonq/lsp/lspController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export class LspController {
}

async buildIndex() {
getLogger().info(`LspController: Starting to build vector index of project`)
getLogger().info(`LspController: Starting to build index of project`)
const start = performance.now()
const projPaths = getProjectPaths()
projPaths.sort()
Expand All @@ -332,7 +332,7 @@ export class LspController {
false
)
if (resp) {
getLogger().debug(`LspController: Finish building vector index of project`)
getLogger().debug(`LspController: Finish building index of project`)
const usage = await LspClient.instance.getLspServerUsage()
telemetry.amazonq_indexWorkspace.emit({
duration: performance.now() - start,
Expand All @@ -344,7 +344,7 @@ export class LspController {
credentialStartUrl: AuthUtil.instance.startUrl,
})
} else {
getLogger().error(`LspController: Failed to build vector index of project`)
getLogger().error(`LspController: Failed to build index of project`)
telemetry.amazonq_indexWorkspace.emit({
duration: performance.now() - start,
result: 'Failed',
Expand All @@ -353,7 +353,7 @@ export class LspController {
})
}
} catch (e) {
getLogger().error(`LspController: Failed to build vector index of project`)
getLogger().error(`LspController: Failed to build index of project`)
telemetry.amazonq_indexWorkspace.emit({
duration: performance.now() - start,
result: 'Failed',
Expand All @@ -372,20 +372,16 @@ export class LspController {
return
}
setImmediate(async () => {
if (!CodeWhispererSettings.instance.isLocalIndexEnabled()) {
// only download LSP for users who did not turn on this feature
// do not start LSP server
await LspController.instance.tryInstallLsp(context)
return
}
const ok = await LspController.instance.tryInstallLsp(context)
if (!ok) {
return
}
try {
await activateLsp(context)
getLogger().info('LspController: LSP activated')
void LspController.instance.buildIndex()
if (CodeWhispererSettings.instance.isLocalIndexEnabled()) {
void LspController.instance.buildIndex()
}
// log the LSP server CPU and Memory usage per 30 minutes.
globals.clock.setInterval(
async () => {
Expand Down
Loading