提交 adb7b656 编写于 作者: M Matt Bierner

Move versions status details into class

上级 85f06958
......@@ -311,11 +311,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
}
this._apiVersion = this.versionPicker.currentVersion.version || API.defaultVersion;
const label = this._apiVersion.versionString;
const tooltip = currentVersion.path;
this.versionStatus.showHideStatus();
this.versionStatus.setInfo(label, tooltip);
this.versionStatus.onDidChangeTypeScriptVersion(currentVersion);
this.requestQueue = new RequestQueue();
this.callbacks = new CallbackMap();
......
......@@ -4,9 +4,10 @@
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import { TypeScriptVersion } from './versionProvider';
export default class VersionStatus {
private onChangeEditorSub: any;
private onChangeEditorSub: vscode.Disposable;
private versionBarEntry: vscode.StatusBarItem;
constructor() {
......@@ -19,7 +20,14 @@ export default class VersionStatus {
this.onChangeEditorSub.dispose();
}
showHideStatus() {
public onDidChangeTypeScriptVersion(version: TypeScriptVersion) {
this.showHideStatus();
this.versionBarEntry.text = version.versionString;
this.versionBarEntry.tooltip = version.path;
this.versionBarEntry.command = 'typescript.selectTypeScriptVersion';
}
private showHideStatus() {
if (!this.versionBarEntry) {
return;
}
......@@ -42,10 +50,4 @@ export default class VersionStatus {
this.versionBarEntry.hide();
}
public setInfo(message: string, tooltip: string) {
this.versionBarEntry.text = message;
this.versionBarEntry.tooltip = tooltip;
this.versionBarEntry.command = 'typescript.selectTypeScriptVersion';
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册