This commit is contained in:
Dirk Baeumer 2015-12-16 15:36:57 +01:00
parent 5bea050a68
commit 41af798248
2 changed files with 8 additions and 5 deletions

View file

@ -14,7 +14,8 @@
},
"activationEvents": [
"onLanguage:typescript",
"onLanguage:typescriptreact"
"onLanguage:typescriptreact",
"onCommand:typescript.reloadProjects"
],
"main": "./out/typescriptMain",
"contributes": {
@ -77,7 +78,8 @@
"commands": [
{
"command": "typescript.reloadProjects",
"title": "TypeScript: Reload Projects"
"title": "Reload Projects",
"category": "TypeScript"
}
],
"debuggers": [

View file

@ -37,13 +37,14 @@ export function activate(context: ExtensionContext): void {
let clientHost = new TypeScriptServiceClientHost();
let client = clientHost.serviceClient;
context.subscriptions.push(commands.registerCommand('typescript.reloadProjects', () => {
clientHost.reloadProjects();
}));
// Register the supports for both TS and TSX so that we can have separate grammars but share the mode
client.onReady().then(() => {
registerSupports(MODE_ID_TS, clientHost, client);
registerSupports(MODE_ID_TSX, clientHost, client);
context.subscriptions.push(commands.registerCommand('typescript.reloadProjects', () => {
clientHost.reloadProjects();
}));
}, () => {
// Nothing to do here. The client did show a message;
})