Simplify startup

This commit is contained in:
Aleksey Kladov 2020-02-17 13:40:20 +01:00
parent dcdbbddd16
commit d24e612106
5 changed files with 25 additions and 33 deletions

View file

@ -17,7 +17,6 @@ export class Ctx {
// on the event loop to get a better picture of what we can do here)
client: lc.LanguageClient | null = null;
private extCtx: vscode.ExtensionContext;
private onStartHooks: Array<(client: lc.LanguageClient) => void> = [];
constructor(extCtx: vscode.ExtensionContext) {
this.config = new Config(extCtx);
@ -39,9 +38,6 @@ export class Ctx {
await client.onReady();
this.client = client;
for (const hook of this.onStartHooks) {
hook(client);
}
}
get activeRustEditor(): vscode.TextEditor | undefined {
@ -69,15 +65,6 @@ export class Ctx {
pushCleanup(d: Disposable) {
this.extCtx.subscriptions.push(d);
}
onStart(hook: (client: lc.LanguageClient) => void) {
const client = this.client;
if (client == null) {
this.onStartHooks.push(hook);
} else {
hook(client)
}
}
}
export interface Disposable {