-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStatusBarItem.js
28 lines (24 loc) · 1013 Bytes
/
StatusBarItem.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const vscode = require("vscode");
module.exports = class StatusBarItem {
constructor() {
this.statusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
this.change();
}
change(isActivated = false) {
if (isActivated) {
this.statusBar.backgroundColor = new vscode.ThemeColor('statusBarItem.background');
this.statusBar.text = "Global Diagnostic";
this.statusBar.tooltip = "Disable Global ESLint Diagnostic";
this.statusBar.command = "extension.global-eslint-diagnostic.disable";
} else {
this.statusBar.backgroundColor = new vscode.ThemeColor('statusBarItem.warningBackground');
this.statusBar.text = "Global Diagnostic";
this.statusBar.tooltip = "Enable Global ESLint Diagnostic";
this.statusBar.command = "extension.global-eslint-diagnostic.enable";
}
this.statusBar.show();
}
hide() {
this.statusBar.hide();
}
}