File tree 3 files changed +13
-8
lines changed 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,10 @@ namespace ts {
314
314
return node && getTypeArgumentConstraint(node);
315
315
},
316
316
getSuggestionDiagnostics: (file, ct) => {
317
+ if (skipTypeChecking(file, compilerOptions)) {
318
+ return emptyArray;
319
+ }
320
+
317
321
let diagnostics: DiagnosticWithLocation[] | undefined;
318
322
try {
319
323
// Record the cancellation token so it can be checked later on during checkSourceElement.
@@ -26887,10 +26891,7 @@ namespace ts {
26887
26891
function checkSourceFileWorker(node: SourceFile) {
26888
26892
const links = getNodeLinks(node);
26889
26893
if (!(links.flags & NodeCheckFlags.TypeChecked)) {
26890
- // If skipLibCheck is enabled, skip type checking if file is a declaration file.
26891
- // If skipDefaultLibCheck is enabled, skip type checking if file contains a
26892
- // '/// <reference no-default-lib="true"/>' directive.
26893
- if (compilerOptions.skipLibCheck && node.isDeclarationFile || compilerOptions.skipDefaultLibCheck && node.hasNoDefaultLib) {
26894
+ if (skipTypeChecking(node, compilerOptions)) {
26894
26895
return;
26895
26896
}
26896
26897
Original file line number Diff line number Diff line change @@ -1476,10 +1476,7 @@ namespace ts {
1476
1476
1477
1477
function getSemanticDiagnosticsForFileNoCache ( sourceFile : SourceFile , cancellationToken : CancellationToken ) : Diagnostic [ ] | undefined {
1478
1478
return runWithCancellationToken ( ( ) => {
1479
- // If skipLibCheck is enabled, skip reporting errors if file is a declaration file.
1480
- // If skipDefaultLibCheck is enabled, skip reporting errors if file contains a
1481
- // '/// <reference no-default-lib="true"/>' directive.
1482
- if ( options . skipLibCheck && sourceFile . isDeclarationFile || options . skipDefaultLibCheck && sourceFile . hasNoDefaultLib ) {
1479
+ if ( skipTypeChecking ( sourceFile , options ) ) {
1483
1480
return emptyArray ;
1484
1481
}
1485
1482
Original file line number Diff line number Diff line change @@ -8225,4 +8225,11 @@ namespace ts {
8225
8225
// Include the `<>`
8226
8226
return { pos : typeParameters . pos - 1 , end : typeParameters . end + 1 } ;
8227
8227
}
8228
+
8229
+ export function skipTypeChecking ( sourceFile : SourceFile , options : CompilerOptions ) {
8230
+ // If skipLibCheck is enabled, skip reporting errors if file is a declaration file.
8231
+ // If skipDefaultLibCheck is enabled, skip reporting errors if file contains a
8232
+ // '/// <reference no-default-lib="true"/>' directive.
8233
+ return options . skipLibCheck && sourceFile . isDeclarationFile || options . skipDefaultLibCheck && sourceFile . hasNoDefaultLib ;
8234
+ }
8228
8235
}
You can’t perform that action at this time.
0 commit comments