add activationEvents
This commit is contained in:
parent
cef7eaffd9
commit
ae46f08fff
2 changed files with 16 additions and 20 deletions
32
package.json
32
package.json
|
@ -12,10 +12,21 @@
|
|||
"build": "tsc -p tsconfig.json",
|
||||
"prepare": "yarn clean && yarn build"
|
||||
},
|
||||
"activationEvents": [
|
||||
"onLanguage:javascript",
|
||||
"onLanguage:javascriptreact",
|
||||
"onLanguage:typescript",
|
||||
"onLanguage:typescriptreact",
|
||||
"onLanguage:jsx-tags",
|
||||
"onCommand:typescript.reloadProjects",
|
||||
"onCommand:javascript.reloadProjects",
|
||||
"onCommand:javascript.goToProjectConfig",
|
||||
"onCommand:typescript.goToProjectConfig",
|
||||
"onCommand:typescript.openTsServerLog",
|
||||
"onCommand:tsserver.watchBuild",
|
||||
"onLanguage:jsonc"
|
||||
],
|
||||
"contributes": {
|
||||
"activationEvents": [
|
||||
"*"
|
||||
],
|
||||
"commands": [
|
||||
{
|
||||
"title": "Reload current project",
|
||||
|
@ -32,21 +43,6 @@
|
|||
"category": "TSServer",
|
||||
"command": "tsserver.goToProjectConfig"
|
||||
},
|
||||
{
|
||||
"title": "Restart tsserver.",
|
||||
"category": "TSServer",
|
||||
"command": "tsserver.restart"
|
||||
},
|
||||
{
|
||||
"title": "Format current buffer.",
|
||||
"category": "TSServer",
|
||||
"command": "tsserver.format"
|
||||
},
|
||||
{
|
||||
"title": "Orgnize imports of current buffer.",
|
||||
"category": "TSServer",
|
||||
"command": "tsserver.organizeImports"
|
||||
},
|
||||
{
|
||||
"title": "Run `tsc --watch` for current project in terminal buffer.",
|
||||
"category": "TSServer",
|
||||
|
|
|
@ -35,8 +35,6 @@ 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 {
|
||||
|
@ -44,6 +42,8 @@ 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
|
||||
|
|
Loading…
Reference in a new issue