-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds a LanguageStatusItem that shows the discovered Terraform version in the current workspace.
- Loading branch information
Showing
3 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as vscode from 'vscode'; | ||
|
||
const terraformStatus = vscode.languages.createLanguageStatusItem('terraform.status', [ | ||
{ language: 'terraform' }, | ||
{ language: 'terraform-vars' }, | ||
]); | ||
terraformStatus.name = 'Terraform'; | ||
terraformStatus.detail = 'Terraform'; | ||
terraformStatus.command = { | ||
command: 'terraform.commands', | ||
title: 'Terraform Commands', | ||
tooltip: 'foo', | ||
}; | ||
|
||
export function setTerraformState( | ||
detail: string, | ||
busy: boolean, | ||
severity: vscode.LanguageStatusSeverity = vscode.LanguageStatusSeverity.Information, | ||
) { | ||
terraformStatus.busy = busy; | ||
terraformStatus.detail = detail; | ||
terraformStatus.severity = severity; | ||
} | ||
|
||
export function setTerraformVersion(version: string) { | ||
terraformStatus.text = version; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters