提交 7895b181 编写于 作者: M Matt Bierner

Extract getCompilerOptions to own method

上级 43acb7d3
......@@ -466,6 +466,15 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
return;
}
const args: Proto.SetCompilerOptionsForInferredProjectsArgs = {
options: this.getCompilerOptionsForInferredProjects(configuration)
};
this.execute('compilerOptionsForInferredProjects', args, true).catch((err) => {
this.error(`'compilerOptionsForInferredProjects' request failed with error.`, err);
});
}
private getCompilerOptionsForInferredProjects(configuration: TypeScriptServiceConfiguration): Proto.ExternalProjectCompilerOptions {
const compilerOptions: Proto.ExternalProjectCompilerOptions = {
module: 'CommonJS' as Proto.ModuleKind,
target: 'ES6' as Proto.ScriptTarget,
......@@ -479,13 +488,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
compilerOptions.checkJs = configuration.checkJs;
compilerOptions.experimentalDecorators = configuration.experimentalDecorators;
}
const args: Proto.SetCompilerOptionsForInferredProjectsArgs = {
options: compilerOptions
};
this.execute('compilerOptionsForInferredProjects', args, true).catch((err) => {
this.error(`'compilerOptionsForInferredProjects' request failed with error.`, err);
});
return compilerOptions;
}
private serviceExited(restart: boolean): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册