We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad9c148 commit f5157efCopy full SHA for f5157ef
src/server/project.ts
@@ -471,6 +471,14 @@ namespace ts.server {
471
// - newProgram is different from the old program and structure of the old program was not reused.
472
if (!oldProgram || (this.program !== oldProgram && !oldProgram.structureIsReused)) {
473
hasChanges = true;
474
+
475
+ const options = this.getCompilerOptions();
476
+ if ((this.projectKind === ProjectKind.Inferred || this.projectKind === ProjectKind.External) && !options.noEmit && allFilesAreJsOrDts(this)) {
477
+ options.noEmit = true;
478
+ // need to get a new program as the compiler option changed.
479
+ this.program = this.languageService.getProgram();
480
+ }
481
482
if (oldProgram) {
483
for (const f of oldProgram.getSourceFiles()) {
484
if (this.program.getSourceFileByPath(f.path)) {
0 commit comments