|
3 | 3 | * SPDX-License-Identifier: Apache-2.0
|
4 | 4 | */
|
5 | 5 |
|
6 |
| -import { authUtils, CredentialsStore, LoginManager, initializeAuth } from 'aws-core-vscode/auth' |
7 |
| -import { activate as activateCodeWhisperer, shutdown as shutdownCodeWhisperer } from 'aws-core-vscode/codewhisperer' |
| 6 | +import { authUtils, CredentialsStore, LoginManager } from 'aws-core-vscode/auth' |
| 7 | +import { |
| 8 | + activate as activateCodeWhisperer, |
| 9 | + refreshStatusBar, |
| 10 | + shutdown as shutdownCodeWhisperer, |
| 11 | + updateReferenceLog, |
| 12 | +} from 'aws-core-vscode/codewhisperer' |
8 | 13 | import { makeEndpointsProvider, registerGenericCommands } from 'aws-core-vscode'
|
9 | 14 | import { CommonAuthWebview } from 'aws-core-vscode/login'
|
10 | 15 | import {
|
@@ -113,16 +118,16 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is
|
113 | 118 |
|
114 | 119 | await activateTelemetry(context, globals.awsContext, Settings.instance, 'Amazon Q For VS Code')
|
115 | 120 |
|
116 |
| - await initializeAuth(globals.loginManager) |
117 |
| - |
118 | 121 | const extContext = {
|
119 | 122 | extensionContext: context,
|
120 | 123 | }
|
121 | 124 |
|
| 125 | + activateAuthDependentCommands() |
| 126 | + |
122 | 127 | // Auth is dependent on LSP, needs to be activated before CW and Inline
|
123 | 128 | await activateAmazonqLsp(context)
|
124 | 129 |
|
125 |
| - // This contains every lsp agnostic things (auth, security scan, code scan) |
| 130 | + // This contains every lsp agnostic things (security scan, code scan) |
126 | 131 | await activateCodeWhisperer(extContext as ExtContext)
|
127 | 132 | if (!Experiments.instance.get('amazonqLSPInline', false)) {
|
128 | 133 | await activateInlineCompletion()
|
@@ -185,6 +190,14 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is
|
185 | 190 | }
|
186 | 191 | })
|
187 | 192 | )
|
| 193 | + |
| 194 | + // Activate commands that are required for activateAmazonqLsp |
| 195 | + function activateAuthDependentCommands() { |
| 196 | + // update reference log instance |
| 197 | + updateReferenceLog.register() |
| 198 | + // refresh codewhisperer status bar |
| 199 | + refreshStatusBar.register() |
| 200 | + } |
188 | 201 | }
|
189 | 202 |
|
190 | 203 | export async function deactivateCommon() {
|
|
0 commit comments