Added status bar item for recognition of an active extension. (#162)

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>
pull/164/head
Jerome Luckenbach 2019-10-26 23:02:39 +02:00 committed by GitHub
parent e0560e3763
commit d95ba9a0ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -7,6 +7,8 @@ import {
languages,
window,
workspace,
StatusBarItem,
StatusBarAlignment
} from 'vscode'
import * as utils from './Utils'
@ -28,6 +30,7 @@ import * as ncp from 'copy-paste'
import * as path from 'path'
let _extensionPath: string;
let ohStatusBarItem: StatusBarItem;
async function init(disposables: Disposable[], config, context): Promise<void> {
@ -187,7 +190,10 @@ async function init(disposables: Disposable[], config, context): Promise<void> {
const localLanguageClientProvider = new LocalLanguageClientProvider()
disposables.push(localLanguageClientProvider.connect(context))
ohStatusBarItem = window.createStatusBarItem(StatusBarAlignment.Right, 20)
ohStatusBarItem.text = `$(home) openHAB`
ohStatusBarItem.tooltip = `openHAB extension is active currently.`
ohStatusBarItem.show();
}
export function activate(context: ExtensionContext) {
@ -208,8 +214,9 @@ export function activate(context: ExtensionContext) {
// this method is called when your extension is deactivated
export function deactivate() {
var message = `openHAB vscode extension has been shut down`;
ohStatusBarItem.hide();
var message = `openHAB vscode extension has been shut down`;
console.log(message);
utils.appendToOutput(message);
}