mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 22:12:26 +01:00
Move versions status details into class
This commit is contained in:
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user