Allow configuring TS Server watch options through VS Code

Fixes #89381

Given that these are advanced options, we require editing them in the json file instead of using our settings UI
This commit is contained in:
Matt Bierner
2020-02-07 18:14:38 -08:00
parent ea54f48dda
commit 718331d6f3
3 changed files with 81 additions and 1 deletions

View File

@@ -477,12 +477,17 @@ export default class TypeScriptServiceClient extends Disposable implements IType
private serviceStarted(resendModels: boolean): void {
this.bufferSyncSupport.reset();
const watchOptions = this.apiVersion.gte(API.v380)
? vscode.workspace.getConfiguration('typescript').get<Proto.WatchOptions | undefined>('tsserver.watchOptions')
: undefined;
const configureOptions: Proto.ConfigureRequestArguments = {
hostInfo: 'vscode',
preferences: {
providePrefixAndSuffixTextForRename: true,
allowRenameOfImportPath: true,
}
},
watchOptions
};
this.executeWithoutWaitingForResponse('configure', configureOptions);
this.setCompilerOptionsForInferredProjects(this._configuration);