MCPcopy Create free account
hub / github.com/nodejs/node / getProgramDiagnostics

Function getProgramDiagnostics

test/fixtures/snapshot/typescript.js:117570–117580  ·  view source on GitHub ↗
(sourceFile)

Source from the content-addressed store, hash-verified

117568 return getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken);
117569 }
117570 function getProgramDiagnostics(sourceFile) {
117571 var _a;
117572 if (ts.skipTypeChecking(sourceFile, options, program)) {
117573 return ts.emptyArray;
117574 }
117575 var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName);
117576 if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) {
117577 return programDiagnosticsInFile;
117578 }
117579 return getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, programDiagnosticsInFile).diagnostics;
117580 }
117581 function getDeclarationDiagnostics(sourceFile, cancellationToken) {
117582 var options = program.getCompilerOptions();
117583 // collect diagnostics from the program only once if either no source file was specified or out/outFile is set (bundled emit)

Callers 1

Tested by

no test coverage detected