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

Function getTextSpan

test/fixtures/snapshot/typescript.js:137243–137252  ·  view source on GitHub ↗
(node, sourceFile, endNode)

Source from the content-addressed store, hash-verified

137241 }
137242 FindAllReferences.toHighlightSpan = toHighlightSpan;
137243 function getTextSpan(node, sourceFile, endNode) {
137244 var start = node.getStart(sourceFile);
137245 var end = (endNode || node).getEnd();
137246 if (ts.isStringLiteralLike(node) && (end - start) > 2) {
137247 ts.Debug.assert(endNode === undefined);
137248 start += 1;
137249 end -= 1;
137250 }
137251 return ts.createTextSpanFromBounds(start, end);
137252 }
137253 function getTextSpanOfEntry(entry) {
137254 return entry.kind === 0 /* EntryKind.Span */ ? entry.textSpan :
137255 getTextSpan(entry.node, entry.node.getSourceFile());

Callers 4

toContextSpanFunction · 0.85
entryToDocumentSpanFunction · 0.85
getTextSpanOfEntryFunction · 0.85

Calls 1

assertMethod · 0.80

Tested by

no test coverage detected