MCPcopy Index your code
hub / github.com/nodejs/node / getSyntacticDiagnosticsForFile

Function getSyntacticDiagnosticsForFile

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

Source from the content-addressed store, hash-verified

117589 }
117590 }
117591 function getSyntacticDiagnosticsForFile(sourceFile) {
117592 // For JavaScript files, we report semantic errors for using TypeScript-only
117593 // constructs from within a JavaScript file as syntactic errors.
117594 if (ts.isSourceFileJS(sourceFile)) {
117595 if (!sourceFile.additionalSyntacticDiagnostics) {
117596 sourceFile.additionalSyntacticDiagnostics = getJSSyntacticDiagnosticsForFile(sourceFile);
117597 }
117598 return ts.concatenate(sourceFile.additionalSyntacticDiagnostics, sourceFile.parseDiagnostics);
117599 }
117600 return sourceFile.parseDiagnostics;
117601 }
117602 function runWithCancellationToken(func) {
117603 try {
117604 return func();

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected