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

Fixed TS version status

上级 a5976acb
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
"out*/**": true, "out*/**": true,
"extensions/**/out/**": true "extensions/**/out/**": true
}, },
"tslint.enable": false, "tslint.enable": true,
"tslint.rulesDirectory": "node_modules/tslint-microsoft-contrib" "tslint.rulesDirectory": "node_modules/tslint-microsoft-contrib"
} }
\ No newline at end of file
...@@ -123,7 +123,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient ...@@ -123,7 +123,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
let label = this.getTypeScriptVersion(modulePath); let label = this.getTypeScriptVersion(modulePath);
let tooltip = modulePath; let tooltip = modulePath;
VersionStatus.show(label, tooltip); VersionStatus.setInfo(label, tooltip);
this.servicePromise = new Promise<cp.ChildProcess>((resolve, reject) => { this.servicePromise = new Promise<cp.ChildProcess>((resolve, reject) => {
try { try {
......
...@@ -7,37 +7,36 @@ ...@@ -7,37 +7,36 @@
import vscode = require('vscode'); import vscode = require('vscode');
let statusBarEntry: vscode.StatusBarItem; let versionBarEntry: vscode.StatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, Number.MIN_VALUE);
export function showHideStatus() { export function showHideStatus() {
if (!statusBarEntry) { if (!versionBarEntry) {
return; return;
} }
if (!vscode.window.activeTextEditor) { if (!vscode.window.activeTextEditor) {
statusBarEntry.hide(); versionBarEntry.hide();
return; return;
} }
let doc = vscode.window.activeTextEditor.document; let doc = vscode.window.activeTextEditor.document;
if (vscode.languages.match('javascript', doc) || vscode.languages.match('javascriptreact', doc) if (vscode.languages.match('javascript', doc) || vscode.languages.match('javascriptreact', doc)
|| vscode.languages.match('typescript', doc) || vscode.languages.match('typescriptreact', doc)) { || vscode.languages.match('typescript', doc) || vscode.languages.match('typescriptreact', doc)) {
statusBarEntry.show(); versionBarEntry.show();
return; return;
} }
statusBarEntry.hide(); versionBarEntry.hide();
} }
export function disposeStatus() { export function disposeStatus() {
if (statusBarEntry) { if (versionBarEntry) {
statusBarEntry.dispose(); versionBarEntry.dispose();
} }
} }
export function show(message: string, tooltip: string) { export function setInfo(message: string, tooltip: string) {
statusBarEntry = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, Number.MIN_VALUE); versionBarEntry.text = message;
statusBarEntry.text = message; versionBarEntry.tooltip = tooltip;
statusBarEntry.tooltip = tooltip;
let color = 'white'; let color = 'white';
statusBarEntry.color = color; versionBarEntry.color = color;
statusBarEntry.show(); 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.
先完成此消息的编辑!
想要评论请 注册