@@ -2428,10 +2428,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2428
2428
return visitEachChild(node, markAsSynthetic, /*context*/ undefined);
2429
2429
}
2430
2430
2431
- function getEmitResolver(sourceFile: SourceFile, cancellationToken: CancellationToken, skipCheck?: boolean ) {
2431
+ function getEmitResolver(sourceFile: SourceFile, cancellationToken: CancellationToken) {
2432
2432
// Ensure we have all the type information in place for this file so that all the
2433
2433
// emitter questions of this resolver will return the right information.
2434
- getDiagnostics(sourceFile, cancellationToken, skipCheck );
2434
+ getDiagnostics(sourceFile, cancellationToken);
2435
2435
return emitResolver;
2436
2436
}
2437
2437
@@ -47483,10 +47483,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
47483
47483
tracing?.pop();
47484
47484
}
47485
47485
47486
- function checkSourceFile(node: SourceFile, skipCheck: boolean | undefined ) {
47486
+ function checkSourceFile(node: SourceFile) {
47487
47487
tracing?.push(tracing.Phase.Check, "checkSourceFile", { path: node.path }, /*separateBeginAndEnd*/ true);
47488
47488
performance.mark("beforeCheck");
47489
- checkSourceFileWorker(node, skipCheck );
47489
+ checkSourceFileWorker(node);
47490
47490
performance.mark("afterCheck");
47491
47491
performance.measure("Check", "beforeCheck", "afterCheck");
47492
47492
tracing?.pop();
@@ -47511,10 +47511,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
47511
47511
}
47512
47512
47513
47513
// Fully type check a source file and collect the relevant diagnostics.
47514
- function checkSourceFileWorker(node: SourceFile, skipCheck: boolean | undefined ) {
47514
+ function checkSourceFileWorker(node: SourceFile) {
47515
47515
const links = getNodeLinks(node);
47516
47516
if (!(links.flags & NodeCheckFlags.TypeChecked)) {
47517
- if (skipCheck || skipTypeChecking(node, compilerOptions, host)) {
47517
+ if (skipTypeChecking(node, compilerOptions, host)) {
47518
47518
return;
47519
47519
}
47520
47520
@@ -47578,13 +47578,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
47578
47578
}
47579
47579
}
47580
47580
47581
- function getDiagnostics(sourceFile: SourceFile, ct: CancellationToken, skipCheck?: boolean ): Diagnostic[] {
47581
+ function getDiagnostics(sourceFile: SourceFile, ct: CancellationToken): Diagnostic[] {
47582
47582
try {
47583
47583
// Record the cancellation token so it can be checked later on during checkSourceElement.
47584
47584
// Do this in a finally block so we can ensure that it gets reset back to nothing after
47585
47585
// this call is done.
47586
47586
cancellationToken = ct;
47587
- return getDiagnosticsWorker(sourceFile, skipCheck );
47587
+ return getDiagnosticsWorker(sourceFile);
47588
47588
}
47589
47589
finally {
47590
47590
cancellationToken = undefined;
@@ -47599,7 +47599,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
47599
47599
deferredDiagnosticsCallbacks = [];
47600
47600
}
47601
47601
47602
- function checkSourceFileWithEagerDiagnostics(sourceFile: SourceFile, skipCheck?: boolean ) {
47602
+ function checkSourceFileWithEagerDiagnostics(sourceFile: SourceFile) {
47603
47603
ensurePendingDiagnosticWorkComplete();
47604
47604
// then setup diagnostics for immediate invocation (as we are about to collect them, and
47605
47605
// this avoids the overhead of longer-lived callbacks we don't need to allocate)
@@ -47608,11 +47608,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
47608
47608
// thus much more likely retaining the same union ordering as before we had lazy diagnostics)
47609
47609
const oldAddLazyDiagnostics = addLazyDiagnostic;
47610
47610
addLazyDiagnostic = cb => cb();
47611
- checkSourceFile(sourceFile, skipCheck );
47611
+ checkSourceFile(sourceFile);
47612
47612
addLazyDiagnostic = oldAddLazyDiagnostics;
47613
47613
}
47614
47614
47615
- function getDiagnosticsWorker(sourceFile: SourceFile, skipCheck: boolean | undefined ): Diagnostic[] {
47615
+ function getDiagnosticsWorker(sourceFile: SourceFile): Diagnostic[] {
47616
47616
if (sourceFile) {
47617
47617
ensurePendingDiagnosticWorkComplete();
47618
47618
// Some global diagnostics are deferred until they are needed and
@@ -47621,7 +47621,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
47621
47621
const previousGlobalDiagnostics = diagnostics.getGlobalDiagnostics();
47622
47622
const previousGlobalDiagnosticsSize = previousGlobalDiagnostics.length;
47623
47623
47624
- checkSourceFileWithEagerDiagnostics(sourceFile, skipCheck );
47624
+ checkSourceFileWithEagerDiagnostics(sourceFile);
47625
47625
47626
47626
const semanticDiagnostics = diagnostics.getDiagnostics(sourceFile.fileName);
47627
47627
const currentGlobalDiagnostics = diagnostics.getGlobalDiagnostics();
@@ -47642,7 +47642,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
47642
47642
47643
47643
// Global diagnostics are always added when a file is not provided to
47644
47644
// getDiagnostics
47645
- forEach(host.getSourceFiles(), sourceFile => checkSourceFileWithEagerDiagnostics(sourceFile, skipCheck) );
47645
+ forEach(host.getSourceFiles(), checkSourceFileWithEagerDiagnostics);
47646
47646
return diagnostics.getDiagnostics();
47647
47647
}
47648
47648
0 commit comments