tsc-ts 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/api/compiler/ast.d.ts +10 -9
- package/dist/api/compiler/ast.js +22 -16
- package/dist/api/compiler/binder-utilities.js +2 -1
- package/dist/api/compiler/binder.js +9 -8
- package/dist/api/compiler/checker-calls.js +3 -2
- package/dist/api/compiler/checker-declaration-order.js +2 -1
- package/dist/api/compiler/checker-declarations.js +14 -14
- package/dist/api/compiler/checker-declared-types.d.ts +1 -1
- package/dist/api/compiler/checker-declared-types.js +12 -11
- package/dist/api/compiler/checker-decorators.js +3 -3
- package/dist/api/compiler/checker-deprecation.js +17 -18
- package/dist/api/compiler/checker-destructuring.d.ts +1 -1
- package/dist/api/compiler/checker-destructuring.js +3 -3
- package/dist/api/compiler/checker-elaboration.js +8 -7
- package/dist/api/compiler/checker-emit-resolver.d.ts +1 -1
- package/dist/api/compiler/checker-emit-resolver.js +5 -4
- package/dist/api/compiler/checker-grammar.js +18 -4
- package/dist/api/compiler/checker-heritage.d.ts +1 -1
- package/dist/api/compiler/checker-heritage.js +14 -13
- package/dist/api/compiler/checker-inference.d.ts +1 -1
- package/dist/api/compiler/checker-inference.js +9 -9
- package/dist/api/compiler/checker-javascript.d.ts +1 -1
- package/dist/api/compiler/checker-javascript.js +5 -4
- package/dist/api/compiler/checker-jsx.d.ts +1 -1
- package/dist/api/compiler/checker-jsx.js +4 -4
- package/dist/api/compiler/checker-literals.js +2 -2
- package/dist/api/compiler/checker-members.d.ts +5 -3
- package/dist/api/compiler/checker-members.js +75 -53
- package/dist/api/compiler/checker-modules.d.ts +1 -1
- package/dist/api/compiler/checker-modules.js +13 -13
- package/dist/api/compiler/checker-object-literals.d.ts +1 -1
- package/dist/api/compiler/checker-object-literals.js +11 -7
- package/dist/api/compiler/checker-overloads.d.ts +1 -1
- package/dist/api/compiler/checker-overloads.js +4 -3
- package/dist/api/compiler/checker-property-access.d.ts +1 -1
- package/dist/api/compiler/checker-property-access.js +2 -2
- package/dist/api/compiler/checker-services.js +2 -2
- package/dist/api/compiler/checker-signatures.d.ts +1 -1
- package/dist/api/compiler/checker-signatures.js +9 -8
- package/dist/api/compiler/checker-symbol-types.d.ts +2 -18
- package/dist/api/compiler/checker-symbol-types.js +22 -952
- package/dist/api/compiler/checker-symbols.d.ts +2 -2
- package/dist/api/compiler/checker-symbols.js +29 -27
- package/dist/api/compiler/checker-type-factory.d.ts +2 -2
- package/dist/api/compiler/checker-type-factory.js +57 -16
- package/dist/api/compiler/checker-type-nodes.d.ts +1 -1
- package/dist/api/compiler/checker-type-nodes.js +2 -2
- package/dist/api/compiler/checker-type-operators.d.ts +1 -1
- package/dist/api/compiler/checker-type-operators.js +5 -5
- package/dist/api/compiler/checker-types.d.ts +73 -7
- package/dist/api/compiler/checker-types.js +220 -43
- package/dist/api/compiler/checker-unused.d.ts +1 -1
- package/dist/api/compiler/checker-unused.js +3 -3
- package/dist/api/compiler/checker.d.ts +29 -8
- package/dist/api/compiler/checker.js +29 -9
- package/dist/api/compiler/diagnostics.d.ts +2 -8
- package/dist/api/compiler/diagnostics.js +4 -40
- package/dist/api/compiler/file-include.d.ts +35 -8
- package/dist/api/compiler/file-include.js +81 -18
- package/dist/api/compiler/file-loader.d.ts +33 -4
- package/dist/api/compiler/file-loader.js +90 -24
- package/dist/api/compiler/instantiation.d.ts +1 -1
- package/dist/api/compiler/instantiation.js +86 -50
- package/dist/api/compiler/link-tables.d.ts +69 -0
- package/dist/api/compiler/link-tables.js +236 -0
- package/dist/api/compiler/name-resolver.js +3 -3
- package/dist/api/compiler/node-builder-names.d.ts +1 -1
- package/dist/api/compiler/node-builder-names.js +12 -12
- package/dist/api/compiler/node-builder-pseudo.d.ts +1 -1
- package/dist/api/compiler/node-builder-pseudo.js +2 -1
- package/dist/api/compiler/node-builder.d.ts +1 -1
- package/dist/api/compiler/node-builder.js +16 -16
- package/dist/api/compiler/parallel-parse.d.ts +2 -0
- package/dist/api/compiler/parallel-parse.js +4 -0
- package/dist/api/compiler/parser.d.ts +33 -16
- package/dist/api/compiler/parser.js +95 -76
- package/dist/api/compiler/printer/emit-context.d.ts +5 -2
- package/dist/api/compiler/printer/emit-context.js +19 -13
- package/dist/api/compiler/program-checker.js +3 -0
- package/dist/api/compiler/program.js +9 -1
- package/dist/api/compiler/relations.d.ts +1 -1
- package/dist/api/compiler/relations.js +10 -10
- package/dist/api/compiler/symbol-accessibility.d.ts +1 -1
- package/dist/api/compiler/symbol-accessibility.js +123 -26
- package/dist/api/compiler/symbol.d.ts +45 -3
- package/dist/api/compiler/symbol.js +121 -10
- package/dist/api/compiler/transformers/alias-references.d.ts +1 -1
- package/dist/api/compiler/transformers/alias-references.js +2 -1
- package/dist/api/compiler/transformers/declarations-diagnostics.js +2 -1
- package/dist/api/compiler/transformers/declarations-pseudo.js +4 -2
- package/dist/api/compiler/transformers/declarations-syntactic.d.ts +1 -1
- package/dist/api/compiler/transformers/declarations-syntactic.js +9 -9
- package/dist/api/compiler/transformers/declarations-tracker.d.ts +1 -1
- package/dist/api/compiler/transformers/declarations-tracker.js +3 -2
- package/dist/api/compiler/transformers/declarations.js +6 -5
- package/dist/api/compiler/transformers/reference-resolver.d.ts +2 -1
- package/dist/api/compiler/transformers/reference-resolver.js +26 -24
- package/dist/api/compiler/transformers/subtree-facts.d.ts +1 -0
- package/dist/api/compiler/transformers/subtree-facts.js +7 -5
- package/dist/api/compiler/transformers/syntax-facts.d.ts +1 -0
- package/dist/api/compiler/transformers/syntax-facts.js +9 -5
- package/dist/api/compiler/transformers/type-serialization.js +12 -12
- package/package.json +9 -9
- package/src/compiler/ast.ts +27 -19
- package/src/compiler/binder-utilities.ts +2 -2
- package/src/compiler/binder.ts +15 -11
- package/src/compiler/checker-calls.ts +3 -3
- package/src/compiler/checker-declaration-order.ts +2 -2
- package/src/compiler/checker-declarations.ts +21 -14
- package/src/compiler/checker-declared-types.ts +12 -12
- package/src/compiler/checker-decorators.ts +3 -3
- package/src/compiler/checker-deprecation.ts +17 -21
- package/src/compiler/checker-destructuring.ts +3 -3
- package/src/compiler/checker-elaboration.ts +8 -8
- package/src/compiler/checker-emit-resolver.ts +5 -5
- package/src/compiler/checker-grammar.ts +17 -5
- package/src/compiler/checker-heritage.ts +21 -14
- package/src/compiler/checker-inference.ts +17 -9
- package/src/compiler/checker-javascript.ts +5 -5
- package/src/compiler/checker-jsx.ts +12 -8
- package/src/compiler/checker-literals.ts +2 -2
- package/src/compiler/checker-members.ts +91 -47
- package/src/compiler/checker-modules.ts +23 -13
- package/src/compiler/checker-object-literals.ts +22 -6
- package/src/compiler/checker-overloads.ts +6 -6
- package/src/compiler/checker-property-access.ts +2 -2
- package/src/compiler/checker-services.ts +2 -2
- package/src/compiler/checker-signatures.ts +9 -9
- package/src/compiler/checker-symbol-types.ts +20 -940
- package/src/compiler/checker-symbols.ts +42 -35
- package/src/compiler/checker-type-factory.ts +53 -16
- package/src/compiler/checker-type-nodes.ts +2 -2
- package/src/compiler/checker-type-operators.ts +13 -5
- package/src/compiler/checker-types.ts +223 -43
- package/src/compiler/checker-unused.ts +3 -3
- package/src/compiler/checker.ts +31 -9
- package/src/compiler/diagnostics.ts +5 -44
- package/src/compiler/file-include.ts +85 -17
- package/src/compiler/file-loader.ts +104 -35
- package/src/compiler/incremental.ts +39 -5
- package/src/compiler/instantiation.ts +99 -55
- package/src/compiler/link-tables.ts +245 -0
- package/src/compiler/name-resolver.ts +3 -3
- package/src/compiler/node-builder-names.ts +21 -19
- package/src/compiler/node-builder-pseudo.ts +2 -2
- package/src/compiler/node-builder.ts +24 -16
- package/src/compiler/parallel-check.ts +11 -8
- package/src/compiler/parallel-parse.ts +5 -0
- package/src/compiler/parse-thread.ts +0 -4
- package/src/compiler/parser.ts +120 -70
- package/src/compiler/printer/emit-context.ts +20 -15
- package/src/compiler/program-checker.ts +2 -0
- package/src/compiler/program.ts +8 -1
- package/src/compiler/relations.ts +10 -10
- package/src/compiler/symbol-accessibility.ts +120 -25
- package/src/compiler/symbol.ts +127 -9
- package/src/compiler/transformers/alias-references.ts +2 -2
- package/src/compiler/transformers/declarations-diagnostics.ts +2 -1
- package/src/compiler/transformers/declarations-pseudo.ts +7 -4
- package/src/compiler/transformers/declarations-syntactic.ts +17 -9
- package/src/compiler/transformers/declarations-tracker.ts +3 -3
- package/src/compiler/transformers/declarations.ts +6 -6
- package/src/compiler/transformers/reference-resolver.ts +37 -25
- package/src/compiler/transformers/subtree-facts.ts +13 -5
- package/src/compiler/transformers/syntax-facts.ts +10 -5
- package/src/compiler/transformers/type-serialization.ts +12 -12
- package/src/compiler/tsc-build.ts +17 -13
- package/src/compiler/tsc-cli.ts +9 -6
- package/src/compiler/tsc-compile.ts +16 -7
- package/src/compiler/tsc-watch.ts +94 -26
|
@@ -182,9 +182,10 @@ export function compileInParallel(
|
|
|
182
182
|
/**
|
|
183
183
|
* The rest of `compileInParallel` for an incremental program with build info: its program is shared with
|
|
184
184
|
* the checker threads first, then the incremental program finds the files a change affects
|
|
185
|
-
* (`IncrementalProgram.
|
|
186
|
-
* (`rechecksOnThreads`), each emitting what the incremental
|
|
187
|
-
* checks (`emitKindsOnCheckers`), and this thread checks and emits
|
|
185
|
+
* and those whose outputs are pending (`IncrementalProgram.filesForCheckers`); the threads check those
|
|
186
|
+
* when they are many enough to be worth it (`rechecksOnThreads`), each emitting what the incremental
|
|
187
|
+
* program's emit would of the files it checks (`emitKindsOnCheckers`), and this thread checks and emits
|
|
188
|
+
* them otherwise.
|
|
188
189
|
*/
|
|
189
190
|
function recheckInParallel(
|
|
190
191
|
sys: System,
|
|
@@ -234,11 +235,18 @@ function recheckInParallel(
|
|
|
234
235
|
incrementalProgram.getGlobalDiagnostics(false).length > 0
|
|
235
236
|
)
|
|
236
237
|
return finish();
|
|
237
|
-
const files = incrementalProgram.
|
|
238
|
-
mark(`${files.length} files to check`);
|
|
238
|
+
const files = incrementalProgram.filesForCheckers();
|
|
239
|
+
mark(`${files.length} files to check or emit`);
|
|
239
240
|
if (!rechecksOnThreads(files, threads, options.checkers !== undefined)) return finish();
|
|
240
241
|
checked.checkOnly = new Set(files);
|
|
241
|
-
startParallelCheck(
|
|
242
|
+
startParallelCheck(
|
|
243
|
+
checked,
|
|
244
|
+
threads,
|
|
245
|
+
finish,
|
|
246
|
+
true,
|
|
247
|
+
incrementalProgram.emitKindsOnCheckers(files),
|
|
248
|
+
incrementalProgram.checksOnCheckers,
|
|
249
|
+
);
|
|
242
250
|
}
|
|
243
251
|
|
|
244
252
|
/**
|
|
@@ -251,7 +259,8 @@ export function rechecksOnThreads(files: readonly SourceFile[], threads: number,
|
|
|
251
259
|
if (files.length < 2 * threads) return false;
|
|
252
260
|
if (checkersGiven) return true;
|
|
253
261
|
let text = 0;
|
|
254
|
-
|
|
262
|
+
// A file's `end` is its text length (reading `text.length` scans a non-ASCII text in scriptc builds).
|
|
263
|
+
for (const file of files) text += file.end;
|
|
255
264
|
return text >= recheckOnThreadsText;
|
|
256
265
|
}
|
|
257
266
|
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
type MessageWithArgs,
|
|
15
15
|
} from './diagnostics.js';
|
|
16
16
|
import { type ExternalModuleIndicatorOptions, ParseOptions, ScriptKind, type SourceFile } from './ast.js';
|
|
17
|
-
import { CompilerHost, FileLoader } from './file-loader.js';
|
|
17
|
+
import { CompilerHost, FileLoader, releaseLater } from './file-loader.js';
|
|
18
18
|
import { CachedFileSystem } from './file-system.js';
|
|
19
19
|
import { clearLibGlobalsCache } from './checker-symbols.js';
|
|
20
20
|
import { forgetLazyJSDocFile, parseSourceFile } from './parser.js';
|
|
@@ -162,6 +162,25 @@ class Stamps {
|
|
|
162
162
|
return false;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
/**
|
|
166
|
+
* The files whose time stamps changed, or `undefined` when a watched directory's did: a file was added,
|
|
167
|
+
* removed or renamed there.
|
|
168
|
+
*/
|
|
169
|
+
changedFiles(): string[] | undefined {
|
|
170
|
+
const files: string[] = [];
|
|
171
|
+
for (const [path, time] of this.times) {
|
|
172
|
+
if (this.sys.getMTime(path) === time) continue;
|
|
173
|
+
if (this.directories.has(path)) return undefined;
|
|
174
|
+
files.push(path);
|
|
175
|
+
}
|
|
176
|
+
return files;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** Takes the current time stamps of `paths`. */
|
|
180
|
+
refresh(paths: readonly string[]): void {
|
|
181
|
+
for (const path of paths) if (this.times.has(path)) this.times.set(path, this.sys.getMTime(path));
|
|
182
|
+
}
|
|
183
|
+
|
|
165
184
|
/**
|
|
166
185
|
* Adds the directories whose events report changes of these paths: each directory, and each file's,
|
|
167
186
|
* and for a file that is a symbolic link, its target's.
|
|
@@ -428,6 +447,8 @@ class Watcher {
|
|
|
428
447
|
* (`computeLastSignatures`).
|
|
429
448
|
*/
|
|
430
449
|
private lastChecked: CheckedProgram | undefined = undefined;
|
|
450
|
+
/** The program of the last build, which a rebuild updates when only the text of its files changed. */
|
|
451
|
+
private lastProgram: Program | undefined = undefined;
|
|
431
452
|
/** Whether a rebuild is running (`poll`), and whether a check came during it. */
|
|
432
453
|
private building = false;
|
|
433
454
|
private checkPending = false;
|
|
@@ -519,10 +540,12 @@ class Watcher {
|
|
|
519
540
|
let rootFilesAdded = false;
|
|
520
541
|
session.onIdle = (batch) => {
|
|
521
542
|
if (!rootFilesAdded) rootFilesAdded = loader.addRootFiles(rootFilesPerChunk);
|
|
522
|
-
loader.
|
|
543
|
+
loader.walkAhead(batch.files);
|
|
523
544
|
};
|
|
524
545
|
session.start(config.fileNames, () => {
|
|
525
546
|
const program = new Program(config, host, loader);
|
|
547
|
+
// The session's callbacks keep the loader: its tasks go once checking has started.
|
|
548
|
+
releaseLater(loader);
|
|
526
549
|
this.files = this.files.next();
|
|
527
550
|
for (const file of program.getSourceFiles()) {
|
|
528
551
|
const indicator = file.externalModuleIndicatorOptions;
|
|
@@ -574,7 +597,7 @@ class Watcher {
|
|
|
574
597
|
if (configChanged && !this.reloadConfig()) return done();
|
|
575
598
|
if (this.configRead && watchRestart.restartsBeforeRebuild()) return done();
|
|
576
599
|
this.status.report(Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
577
|
-
this.build(done);
|
|
600
|
+
this.build(done, configChanged ? undefined : this.stamps.changedFiles());
|
|
578
601
|
}
|
|
579
602
|
|
|
580
603
|
/** Rereads the config file; false (after reporting) if it can't be used. */
|
|
@@ -597,24 +620,31 @@ class Watcher {
|
|
|
597
620
|
return true;
|
|
598
621
|
}
|
|
599
622
|
|
|
600
|
-
/**
|
|
601
|
-
|
|
623
|
+
/**
|
|
624
|
+
* Builds, on checker threads when the change affects many files, then calls `done`. `changedFiles` are
|
|
625
|
+
* the files whose time stamps changed, when no watched directory's and no config file's did.
|
|
626
|
+
*/
|
|
627
|
+
private build(done: () => void, changedFiles?: readonly string[]): void {
|
|
602
628
|
releaseProgramCaches();
|
|
603
629
|
const sys = this.sys;
|
|
604
630
|
const fs = new CachedFileSystem(new SystemFileSystem(sys));
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
631
|
+
let program = changedFiles !== undefined ? this.updatedProgram(changedFiles, fs) : undefined;
|
|
632
|
+
if (program === undefined) {
|
|
633
|
+
changedFiles = undefined;
|
|
634
|
+
if (this.config.configName !== '') {
|
|
635
|
+
// Pick up files added to or removed from included directories.
|
|
636
|
+
const parsed = new ConfigParser(fs, sys.currentDirectory).parseConfigFile(
|
|
637
|
+
this.config.configName,
|
|
638
|
+
this.commandLine.options,
|
|
639
|
+
this.commandLine.raw,
|
|
640
|
+
[],
|
|
641
|
+
);
|
|
642
|
+
if (parsed !== undefined) this.config = parsed;
|
|
643
|
+
}
|
|
644
|
+
this.files = this.files.next();
|
|
645
|
+
// A copy: a program shared with checker threads holds its config's errors (`copyCommandLine`).
|
|
646
|
+
program = new Program(copyCommandLine(this.config), new WatchCompilerHost(sys, fs, this.locale, this.files));
|
|
614
647
|
}
|
|
615
|
-
this.files = this.files.next();
|
|
616
|
-
// A copy: a program shared with checker threads holds its config's errors (`copyCommandLine`).
|
|
617
|
-
const program = new Program(copyCommandLine(this.config), new WatchCompilerHost(sys, fs, this.locale, this.files));
|
|
618
648
|
// The signatures the last build left as versions, for the files this one parsed.
|
|
619
649
|
if (this.lastChecked !== undefined && this.snapshot !== undefined)
|
|
620
650
|
computeLastSignatures(this.snapshot, this.lastChecked, this.files.parsed);
|
|
@@ -623,11 +653,36 @@ class Watcher {
|
|
|
623
653
|
const signatures = new Map<string, string>();
|
|
624
654
|
const threads = this.rebuildThreads(checked, signatures);
|
|
625
655
|
// A new checker for checker threads: `rebuildThreads` may have emitted declarations with this one.
|
|
626
|
-
if (threads > 1) return this.recheckOnThreads(new CheckedProgram(program), threads, signatures, done);
|
|
627
|
-
this.finishBuild(checked, signatures);
|
|
656
|
+
if (threads > 1) return this.recheckOnThreads(new CheckedProgram(program), threads, signatures, done, changedFiles);
|
|
657
|
+
this.finishBuild(checked, signatures, changedFiles);
|
|
628
658
|
done();
|
|
629
659
|
}
|
|
630
660
|
|
|
661
|
+
/**
|
|
662
|
+
* The last build's program with `changedFiles` read again (`Program.updateFile`, as tsgo's watch swaps a
|
|
663
|
+
* changed file into its program), or `undefined` when one of them cannot be swapped in and the program
|
|
664
|
+
* must be loaded again. No directory and no config file changed, so the root files are the same. The
|
|
665
|
+
* source files of the updated program are those of the next build (`WatchSourceFiles`), which takes the
|
|
666
|
+
* unchanged ones without reading them.
|
|
667
|
+
*/
|
|
668
|
+
private updatedProgram(changedFiles: readonly string[], fs: CachedFileSystem): Program | undefined {
|
|
669
|
+
let program = this.lastProgram;
|
|
670
|
+
if (program === undefined) return undefined;
|
|
671
|
+
const files = this.files.next();
|
|
672
|
+
const host = new WatchCompilerHost(this.sys, fs, this.locale, files);
|
|
673
|
+
for (const fileName of changedFiles) {
|
|
674
|
+
const file = program.getSourceFile(fileName);
|
|
675
|
+
if (file === undefined) return undefined;
|
|
676
|
+
program = program.updateFile(file.path, host);
|
|
677
|
+
if (program === undefined) return undefined;
|
|
678
|
+
}
|
|
679
|
+
for (const file of program.getSourceFiles())
|
|
680
|
+
files.current.set(watchFileKey(file.fileName, file.path, file.externalModuleIndicatorOptions), file);
|
|
681
|
+
this.files = files;
|
|
682
|
+
mark(`program updated, ${changedFiles.length} files`);
|
|
683
|
+
return program;
|
|
684
|
+
}
|
|
685
|
+
|
|
631
686
|
/**
|
|
632
687
|
* The checker threads for a rebuild of `checked`, or 1 to check it on this thread: threads where the
|
|
633
688
|
* change may affect enough files for them (`rechecksOnThreads`), counting each changed file and every
|
|
@@ -696,6 +751,7 @@ class Watcher {
|
|
|
696
751
|
threads: number,
|
|
697
752
|
signatures: ReadonlyMap<string, string>,
|
|
698
753
|
done: () => void,
|
|
754
|
+
changedFiles?: readonly string[],
|
|
699
755
|
): void {
|
|
700
756
|
const sys = this.sys;
|
|
701
757
|
const program = checked.program;
|
|
@@ -714,14 +770,14 @@ class Watcher {
|
|
|
714
770
|
if (rechecksOnThreads(files, threads, options.checkers !== undefined)) {
|
|
715
771
|
checked.checkOnly = new Set(files);
|
|
716
772
|
const finish = (): void => {
|
|
717
|
-
this.report(incremental);
|
|
773
|
+
this.report(incremental, changedFiles);
|
|
718
774
|
done();
|
|
719
775
|
};
|
|
720
776
|
startParallelCheck(checked, threads, finish, true, incremental.emitKindsOnCheckers(files));
|
|
721
777
|
return;
|
|
722
778
|
}
|
|
723
779
|
}
|
|
724
|
-
this.report(incremental);
|
|
780
|
+
this.report(incremental, changedFiles);
|
|
725
781
|
done();
|
|
726
782
|
}
|
|
727
783
|
|
|
@@ -729,13 +785,23 @@ class Watcher {
|
|
|
729
785
|
* Checks (where checker threads didn't), emits and reports `checked`, and watches its inputs. `signatures`
|
|
730
786
|
* are the shape signatures computed for `checked`'s files before (`rebuildThreads`).
|
|
731
787
|
*/
|
|
732
|
-
private finishBuild(
|
|
788
|
+
private finishBuild(
|
|
789
|
+
checked: CheckedProgram,
|
|
790
|
+
signatures?: ReadonlyMap<string, string>,
|
|
791
|
+
changedFiles?: readonly string[],
|
|
792
|
+
): void {
|
|
733
793
|
const times = new CompileTimes();
|
|
734
|
-
this.report(
|
|
794
|
+
this.report(
|
|
795
|
+
new IncrementalProgram(checked, times, this.snapshot, new SystemTimeStamps(this.sys), signatures),
|
|
796
|
+
changedFiles,
|
|
797
|
+
);
|
|
735
798
|
}
|
|
736
799
|
|
|
737
|
-
/**
|
|
738
|
-
|
|
800
|
+
/**
|
|
801
|
+
* Checks (where checker threads didn't), emits and reports `incremental`, and watches its inputs: those of a
|
|
802
|
+
* program `updatedProgram` made are the last build's, with new time stamps for `changedFiles`.
|
|
803
|
+
*/
|
|
804
|
+
private report(incremental: IncrementalProgram, changedFiles?: readonly string[]): void {
|
|
739
805
|
const sys = this.sys;
|
|
740
806
|
const program = incremental.program;
|
|
741
807
|
const result = emitFilesAndReportErrors(
|
|
@@ -748,7 +814,9 @@ class Watcher {
|
|
|
748
814
|
);
|
|
749
815
|
this.snapshot = incremental.snapshot;
|
|
750
816
|
this.lastChecked = incremental.checked;
|
|
751
|
-
this.
|
|
817
|
+
this.lastProgram = program;
|
|
818
|
+
if (changedFiles !== undefined) this.stamps.refresh(changedFiles);
|
|
819
|
+
else this.watchInputs(program);
|
|
752
820
|
this.status.reportErrorCount(result.diagnostics.length);
|
|
753
821
|
}
|
|
754
822
|
|