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

Function findDiagnosticForNode

test/fixtures/snapshot/typescript.js:129352–129360  ·  view source on GitHub ↗
(node, sortedFileDiagnostics)

Source from the content-addressed store, hash-verified

129350 }
129351 ts.isDiagnosticWithLocation = isDiagnosticWithLocation;
129352 function findDiagnosticForNode(node, sortedFileDiagnostics) {
129353 var span = createTextSpanFromNode(node);
129354 var index = ts.binarySearchKey(sortedFileDiagnostics, span, ts.identity, ts.compareTextSpans);
129355 if (index >= 0) {
129356 var diagnostic = sortedFileDiagnostics[index];
129357 ts.Debug.assertEqual(diagnostic.file, node.getSourceFile(), "Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile");
129358 return ts.cast(diagnostic, isDiagnosticWithLocation);
129359 }
129360 }
129361 ts.findDiagnosticForNode = findDiagnosticForNode;
129362 function getDiagnosticsWithinSpan(span, sortedFileDiagnostics) {
129363 var _a;

Callers

nothing calls this directly

Calls 1

createTextSpanFromNodeFunction · 0.85

Tested by

no test coverage detected