@@ -14,7 +14,7 @@ import { config, getActiveTextEditor } from './vscodeUtils';
14
14
15
15
const brand = `HashiCorp Terraform` ;
16
16
const outputChannel = vscode . window . createOutputChannel ( brand ) ;
17
- const terraformStatus = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left , 0 ) ;
17
+ export let terraformStatus : vscode . StatusBarItem ;
18
18
19
19
let reporter : TelemetryReporter ;
20
20
let clientHandler : ClientHandler ;
@@ -27,6 +27,7 @@ export interface TerraformExtension {
27
27
28
28
export async function activate ( context : vscode . ExtensionContext ) : Promise < TerraformExtension > {
29
29
const manifest = context . extension . packageJSON ;
30
+ terraformStatus = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left , 0 ) ;
30
31
reporter = new TelemetryReporter ( context . extension . id , manifest . version , manifest . appInsightsKey ) ;
31
32
context . subscriptions . push ( reporter ) ;
32
33
@@ -157,8 +158,9 @@ export async function deactivate(): Promise<void> {
157
158
return clientHandler . stopClient ( ) ;
158
159
}
159
160
160
- async function updateTerraformStatusBar ( documentUri : vscode . Uri ) : Promise < void > {
161
- const initSupported = clientHandler . clientSupportsCommand ( 'terraform-ls.terraform.init' ) ;
161
+ export async function updateTerraformStatusBar ( documentUri : vscode . Uri ) : Promise < void > {
162
+ const client = clientHandler . getClient ( ) ;
163
+ const initSupported = clientHandler . clientSupportsCommand ( `${ client . commandPrefix } .terraform-ls.terraform.init` ) ;
162
164
if ( initSupported ) {
163
165
const client = clientHandler . getClient ( ) ;
164
166
const moduleUri = Utils . dirname ( documentUri ) ;
@@ -175,6 +177,7 @@ async function updateTerraformStatusBar(documentUri: vscode.Uri): Promise<void>
175
177
terraformStatus . show ( ) ;
176
178
} else {
177
179
terraformStatus . hide ( ) ;
180
+ terraformStatus . text = '' ;
178
181
}
179
182
} catch ( err ) {
180
183
vscode . window . showErrorMessage ( err ) ;
0 commit comments