Reset the noEmitForJsFiles option when updating compiler options (#12570)

* Reset the noEmitForJsFiles option when updating compiler options

* add tests and remove duplicates

* Change test req number

* make setInternalCompilerOptionsForEmittingJsFiles private
This commit is contained in:
Zhengbo Li
2016-11-29 22:31:26 -08:00
committed by GitHub
parent 501bfb5326
commit dfe45fe33d
2 changed files with 67 additions and 3 deletions

View File

@@ -248,9 +248,7 @@ namespace ts.server {
this.compilerOptions.allowNonTsExtensions = true;
}
if (this.projectKind === ProjectKind.Inferred || this.projectKind === ProjectKind.External) {
this.compilerOptions.noEmitForJsFiles = true;
}
this.setInternalCompilerOptionsForEmittingJsFiles();
this.lsHost = new LSHost(this.projectService.host, this, this.projectService.cancellationToken);
this.lsHost.setCompilationSettings(this.compilerOptions);
@@ -266,6 +264,12 @@ namespace ts.server {
this.markAsDirty();
}
private setInternalCompilerOptionsForEmittingJsFiles() {
if (this.projectKind === ProjectKind.Inferred || this.projectKind === ProjectKind.External) {
this.compilerOptions.noEmitForJsFiles = true;
}
}
getProjectErrors() {
return this.projectErrors;
}
@@ -637,6 +641,7 @@ namespace ts.server {
this.lastCachedUnresolvedImportsList = undefined;
}
this.compilerOptions = compilerOptions;
this.setInternalCompilerOptionsForEmittingJsFiles();
this.lsHost.setCompilationSettings(compilerOptions);
this.markAsDirty();