From da3607afc3dd57d9a2ceb8ac66346577d3732542 Mon Sep 17 00:00:00 2001 From: chemzqm Date: Sat, 8 Sep 2018 16:42:09 +0800 Subject: [PATCH] feat(client): create client on actived --- package.json | 3 +++ src/server/index.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0ed5999..825cfe0 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,9 @@ "prepare": "yarn clean && yarn build" }, "contributes": { + "activationEvents": [ + "*" + ], "commands": [ { "title": "Reload current project", diff --git a/src/server/index.ts b/src/server/index.ts index 75c4964..07e6fd6 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -35,6 +35,8 @@ export default class TsserverService implements IServiceProvider { this.selector = this.descriptions.reduce((arr, c) => { return arr.concat(c.modeIds) }, []) + this.clientHost = new TypeScriptServiceClientHost(this.descriptions) + this.disposables.push(this.clientHost) } public get config(): WorkspaceConfiguration { @@ -42,8 +44,6 @@ export default class TsserverService implements IServiceProvider { } public start(): Promise { - this.clientHost = new TypeScriptServiceClientHost(this.descriptions) - this.disposables.push(this.clientHost) Object.defineProperty(this, 'state', { get: () => { return this.clientHost.serviceClient.state