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

Function toHighlightSpan

test/fixtures/snapshot/typescript.js:137227–137241  ·  view source on GitHub ↗
(entry)

Source from the content-addressed store, hash-verified

137225 }
137226 }
137227 function toHighlightSpan(entry) {
137228 var documentSpan = entryToDocumentSpan(entry);
137229 if (entry.kind === 0 /* EntryKind.Span */) {
137230 return {
137231 fileName: documentSpan.fileName,
137232 span: {
137233 textSpan: documentSpan.textSpan,
137234 kind: "reference" /* HighlightSpanKind.reference */
137235 }
137236 };
137237 }
137238 var writeAccess = isWriteAccessForReference(entry.node);
137239 var span = __assign({ textSpan: documentSpan.textSpan, kind: writeAccess ? "writtenReference" /* HighlightSpanKind.writtenReference */ : "reference" /* HighlightSpanKind.reference */, isInString: entry.kind === 2 /* EntryKind.StringLiteral */ ? true : undefined }, documentSpan.contextSpan && { contextSpan: documentSpan.contextSpan });
137240 return { fileName: documentSpan.fileName, span: span };
137241 }
137242 FindAllReferences.toHighlightSpan = toHighlightSpan;
137243 function getTextSpan(node, sourceFile, endNode) {
137244 var start = node.getStart(sourceFile);

Callers

nothing calls this directly

Calls 2

entryToDocumentSpanFunction · 0.85

Tested by

no test coverage detected