File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,13 @@ import vscode from 'vscode'
77import { startLanguageServer } from './client'
88import { AmazonQLspInstaller } from './lspInstaller'
99import { lspSetupStage , ToolkitError , messages } from 'aws-core-vscode/shared'
10- import { AuthUtil } from 'aws-core-vscode/codewhisperer'
1110
1211export async function activate ( ctx : vscode . ExtensionContext ) {
1312 try {
1413 await lspSetupStage ( 'all' , async ( ) => {
1514 const installResult = await new AmazonQLspInstaller ( ) . resolve ( )
1615 return await lspSetupStage ( 'launch' , ( ) => startLanguageServer ( ctx , installResult . resourcePaths ) )
1716 } )
18- await AuthUtil . instance . restore ( )
1917 } catch ( err ) {
2018 const e = err as ToolkitError
2119 void messages . showViewLogsMessage ( `Failed to launch Amazon Q language server: ${ e . message } ` )
Original file line number Diff line number Diff line change @@ -175,7 +175,12 @@ export async function startLanguageServer(
175175 toDispose . push ( disposable )
176176
177177 await client . onReady ( )
178+
179+ // IMPORTANT: This sets up Auth and must be called before anything attempts to use it
178180 AuthUtil . create ( new auth2 . LanguageClientAuth ( client , clientId , encryptionKey ) )
181+ // Ideally this would be part of AuthUtil.create() as it restores the existing Auth connection, but we have some
182+ // future work which will need to delay this call
183+ await AuthUtil . instance . restore ( )
179184
180185 await postStartLanguageServer ( client , resourcePaths , toDispose )
181186
You can’t perform that action at this time.
0 commit comments