Fixed TS version status
This commit is contained in:
parent
a5976acb36
commit
07e3011a62
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
@ -12,6 +12,6 @@
|
|||
"out*/**": true,
|
||||
"extensions/**/out/**": true
|
||||
},
|
||||
"tslint.enable": false,
|
||||
"tslint.enable": true,
|
||||
"tslint.rulesDirectory": "node_modules/tslint-microsoft-contrib"
|
||||
}
|
|
@ -123,7 +123,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
|
|||
|
||||
let label = this.getTypeScriptVersion(modulePath);
|
||||
let tooltip = modulePath;
|
||||
VersionStatus.show(label, tooltip);
|
||||
VersionStatus.setInfo(label, tooltip);
|
||||
|
||||
this.servicePromise = new Promise<cp.ChildProcess>((resolve, reject) => {
|
||||
try {
|
||||
|
|
|
@ -7,37 +7,36 @@
|
|||
|
||||
import vscode = require('vscode');
|
||||
|
||||
let statusBarEntry: vscode.StatusBarItem;
|
||||
let versionBarEntry: vscode.StatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, Number.MIN_VALUE);
|
||||
|
||||
export function showHideStatus() {
|
||||
if (!statusBarEntry) {
|
||||
if (!versionBarEntry) {
|
||||
return;
|
||||
}
|
||||
if (!vscode.window.activeTextEditor) {
|
||||
statusBarEntry.hide();
|
||||
versionBarEntry.hide();
|
||||
return;
|
||||
}
|
||||
let doc = vscode.window.activeTextEditor.document;
|
||||
if (vscode.languages.match('javascript', doc) || vscode.languages.match('javascriptreact', doc)
|
||||
|| vscode.languages.match('typescript', doc) || vscode.languages.match('typescriptreact', doc)) {
|
||||
|
||||
statusBarEntry.show();
|
||||
versionBarEntry.show();
|
||||
return;
|
||||
}
|
||||
statusBarEntry.hide();
|
||||
versionBarEntry.hide();
|
||||
}
|
||||
|
||||
export function disposeStatus() {
|
||||
if (statusBarEntry) {
|
||||
statusBarEntry.dispose();
|
||||
if (versionBarEntry) {
|
||||
versionBarEntry.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
export function show(message: string, tooltip: string) {
|
||||
statusBarEntry = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, Number.MIN_VALUE);
|
||||
statusBarEntry.text = message;
|
||||
statusBarEntry.tooltip = tooltip;
|
||||
export function setInfo(message: string, tooltip: string) {
|
||||
versionBarEntry.text = message;
|
||||
versionBarEntry.tooltip = tooltip;
|
||||
let color = 'white';
|
||||
statusBarEntry.color = color;
|
||||
statusBarEntry.show();
|
||||
versionBarEntry.color = color;
|
||||
versionBarEntry.show();
|
||||
}
|
Loading…
Reference in a new issue