提交 07e3011a 编写于 作者: D Dirk Baeumer

Fixed TS version status

上级 a5976acb
......@@ -12,6 +12,6 @@
"out*/**": true,
"extensions/**/out/**": true
},
"tslint.enable": false,
"tslint.enable": true,
"tslint.rulesDirectory": "node_modules/tslint-microsoft-contrib"
}
\ No newline at end of file
......@@ -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();
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册