File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
packages/core/src/amazonq/lsp Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ import { CodeWhispererSettings } from '../../codewhisperer/util/codewhispererSet
4040import { fs } from '../../shared/fs/fs'
4141import { getLogger } from '../../shared/logger/logger'
4242import globals from '../../shared/extensionGlobals'
43- import { sleep , waitUntil } from '../../shared/utilities/timeoutUtils'
43+ import { waitUntil } from '../../shared/utilities/timeoutUtils'
4444
4545const localize = nls . loadMessageBundle ( )
4646
@@ -225,13 +225,6 @@ export class LspClient {
225225 async waitUntilReady ( ) {
226226 return waitUntil (
227227 async ( ) => {
228- for ( let i = 0 ; i < 5 ; i ++ ) {
229- if ( this . client !== undefined ) {
230- break
231- } else {
232- await sleep ( 5_000 )
233- }
234- }
235228 if ( this . client === undefined ) {
236229 return false
237230 }
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import { ToolkitError } from '../../shared/errors'
2424import { isWeb } from '../../shared/extensionGlobals'
2525import { getUserAgent } from '../../shared/telemetry/util'
2626import { isAmazonInternalOs } from '../../shared/vscode/env'
27+ import { sleep } from '../../shared/utilities/timeoutUtils'
2728
2829export interface Chunk {
2930 readonly filePath : string
@@ -399,7 +400,8 @@ export class LspController {
399400 try {
400401 await activateLsp ( context )
401402 getLogger ( ) . info ( 'LspController: LSP activated' )
402- void LspController . instance . buildIndex ( buildIndexConfig )
403+ await vscode . commands . executeCommand ( `aws.amazonq.updateContextCommandItems` )
404+ await sleep ( 5_000 ) . then ( void LspController . instance . buildIndex ( buildIndexConfig ) )
403405 // log the LSP server CPU and Memory usage per 30 minutes.
404406 globals . clock . setInterval (
405407 async ( ) => {
You can’t perform that action at this time.
0 commit comments