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

Function getOccurrencesAtPosition

test/fixtures/snapshot/typescript.js:165371–165373  ·  view source on GitHub ↗
(fileName, position)

Source from the content-addressed store, hash-verified

165369 }
165370 /// References and Occurrences
165371 function getOccurrencesAtPosition(fileName, position) {
165372 return ts.flatMap(getDocumentHighlights(fileName, position, [fileName]), function (entry) { return entry.highlightSpans.map(function (highlightSpan) { return (__assign(__assign({ fileName: entry.fileName, textSpan: highlightSpan.textSpan, isWriteAccess: highlightSpan.kind === "writtenReference" /* HighlightSpanKind.writtenReference */ }, highlightSpan.isInString && { isInString: true }), highlightSpan.contextSpan && { contextSpan: highlightSpan.contextSpan })); }); });
165373 }
165374 function getDocumentHighlights(fileName, position, filesToSearch) {
165375 var normalizedFileName = ts.normalizePath(fileName);
165376 ts.Debug.assert(filesToSearch.some(function (f) { return ts.normalizePath(f) === normalizedFileName; }));

Callers

nothing calls this directly

Calls 3

getDocumentHighlightsFunction · 0.85
flatMapMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected