提交 f896092d 编写于 作者: D Dirk Baeumer

Fixes #1342

上级 c27759dd
...@@ -74,6 +74,12 @@ ...@@ -74,6 +74,12 @@
"command": "^acceptSelectedSuggestion", "command": "^acceptSelectedSuggestion",
"when": "editorTextFocus && suggestWidgetVisible && editorLangId == 'typescript' && suggestionSupportsAcceptOnKey" "when": "editorTextFocus && suggestWidgetVisible && editorLangId == 'typescript' && suggestionSupportsAcceptOnKey"
}, },
"commands": [
{
"command": "typescript.reloadProjects",
"title": "TypeScript: Reload Projects"
}
],
"debuggers": [ "debuggers": [
{ {
"type": "node", "type": "node",
......
{ {
"compilerOptions": { "compilerOptions": {
"noLib": true, "noLib": true,
"target": "ES5", "target": "es5",
"module": "commonjs", "module": "commonjs",
"sourceMap": true, "sourceMap": false,
"outDir": "../out" "outDir": "../out"
}, },
"exclude": [ "exclude": [
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* ------------------------------------------------------------------------------------------ */ * ------------------------------------------------------------------------------------------ */
'use strict'; 'use strict';
import { languages, workspace, Uri, ExtensionContext, IndentAction, Diagnostic, DiagnosticCollection, Range } from 'vscode'; import { languages, commands, workspace, Uri, ExtensionContext, IndentAction, Diagnostic, DiagnosticCollection, Range } from 'vscode';
import * as Proto from './protocol'; import * as Proto from './protocol';
import TypeScriptServiceClient from './typescriptServiceClient'; import TypeScriptServiceClient from './typescriptServiceClient';
...@@ -41,6 +41,9 @@ export function activate(context: ExtensionContext): void { ...@@ -41,6 +41,9 @@ export function activate(context: ExtensionContext): void {
client.onReady().then(() => { client.onReady().then(() => {
registerSupports(MODE_ID_TS, clientHost, client); registerSupports(MODE_ID_TS, clientHost, client);
registerSupports(MODE_ID_TSX, 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; // Nothing to do here. The client did show a message;
}) })
...@@ -166,6 +169,11 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { ...@@ -166,6 +169,11 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost {
return this.client; return this.client;
} }
public reloadProjects(): void {
this.client.execute('reloadProjects', null, false);
this.triggerAllDiagnostics();
}
public addBufferSyncSupport(support: BufferSyncSupport): void { public addBufferSyncSupport(support: BufferSyncSupport): void {
this.bufferSyncSupports.push(support); this.bufferSyncSupports.push(support);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册