feat(client): create client on actived

This commit is contained in:
chemzqm 2018-09-08 16:42:09 +08:00
parent e75600b67e
commit da3607afc3
2 changed files with 5 additions and 2 deletions

View file

@ -13,6 +13,9 @@
"prepare": "yarn clean && yarn build"
},
"contributes": {
"activationEvents": [
"*"
],
"commands": [
{
"title": "Reload current project",

View file

@ -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<void> {
this.clientHost = new TypeScriptServiceClientHost(this.descriptions)
this.disposables.push(this.clientHost)
Object.defineProperty(this, 'state', {
get: () => {
return this.clientHost.serviceClient.state