set the option when creating inferred projects

This commit is contained in:
zhengbli
2016-12-28 08:15:21 -08:00
parent 8648239e64
commit a8a1a826b3
2 changed files with 6 additions and 7 deletions

View File

@@ -1079,6 +1079,12 @@ namespace ts.server {
project,
fileName => this.onConfigFileAddedForInferredProject(fileName));
if (root.scriptKind === ScriptKind.JS || root.scriptKind === ScriptKind.JSX) {
const options = project.getCompilerOptions();
options.maxNodeModuleJsDepth = 2;
project.setCompilerOptions(options);
}
project.updateGraph();
if (!useExistingProject) {

View File

@@ -169,13 +169,6 @@ namespace ts.server {
this.compilerOptions.allowNonTsExtensions = true;
}
if (this.projectKind === ProjectKind.Inferred) {
// Add default compiler options for inferred projects here
if (this.compilerOptions.maxNodeModuleJsDepth === undefined) {
this.compilerOptions.maxNodeModuleJsDepth = 2;
}
}
this.setInternalCompilerOptionsForEmittingJsFiles();
this.lsHost = new LSHost(this.projectService.host, this, this.projectService.cancellationToken);