diff --git a/extensions/typescript/src/typescriptServiceClient.ts b/extensions/typescript/src/typescriptServiceClient.ts index c757ce998cf44cfcbd03377439cd2bb36134cc10..58c57b2b183194e2d021c481ba91fe84781208a4 100644 --- a/extensions/typescript/src/typescriptServiceClient.ts +++ b/extensions/typescript/src/typescriptServiceClient.ts @@ -110,7 +110,6 @@ enum MessageAction { useLocal, useBundled, learnMore, - close, reportIssue } @@ -166,7 +165,6 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient private _apiVersion: API; private telemetryReporter: TelemetryReporter; - constructor(host: ITypescriptServiceClientHost, storagePath: string | undefined, globalState: Memento, private workspaceState: Memento, disposables: Disposable[]) { this.host = host; this.storagePath = storagePath; @@ -199,16 +197,34 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient this.trace = this.readTrace(); this.tsServerLogLevel = this.readTsServerLogLevel(); disposables.push(workspace.onDidChangeConfiguration(() => { - this.trace = this.readTrace(); + let oldLoggingLevel = this.tsServerLogLevel; let oldglobalTsdk = this.globalTsdk; let oldLocalTsdk = this.localTsdk; + this.trace = this.readTrace(); + this.tsServerLogLevel = this.readTsServerLogLevel(); + const configuration = workspace.getConfiguration(); this.globalTsdk = this.extractGlobalTsdk(configuration); this.localTsdk = this.extractLocalTsdk(configuration); if (this.servicePromise === null && (oldglobalTsdk !== this.globalTsdk || oldLocalTsdk !== this.localTsdk)) { this.startService(); + } else if (this.servicePromise !== null && this.tsServerLogLevel !== oldLoggingLevel) { + + const reloadItem = { title: localize('reloadTitle', 'Reload') }; + window.showInformationMessage( + localize('tsserverLogReloadBlurb', 'Reload window to apply \'typescript.tsserver.log\' change'), + reloadItem, + { + title: localize('later', 'Later'), + isCloseAffordance: true + }) + .then(selected => { + if (selected === reloadItem) { + commands.executeCommand('workbench.action.reloadWindow'); + } + }); } })); if (this.packageInfo && this.packageInfo.aiKey) {