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

Function checkForUsedDeclarations

test/fixtures/snapshot/typescript.js:161579–161606  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

161577 return symbolId;
161578 }
161579 function checkForUsedDeclarations(node) {
161580 // If this node is entirely within the original extraction range, we don't need to do anything.
161581 if (node === targetRange.range || (isReadonlyArray(targetRange.range) && targetRange.range.indexOf(node) >= 0)) {
161582 return;
161583 }
161584 // Otherwise check and recurse.
161585 var sym = ts.isIdentifier(node)
161586 ? getSymbolReferencedByIdentifier(node)
161587 : checker.getSymbolAtLocation(node);
161588 if (sym) {
161589 var decl = ts.find(visibleDeclarationsInExtractedRange, function (d) { return d.symbol === sym; });
161590 if (decl) {
161591 if (ts.isVariableDeclaration(decl)) {
161592 var idString = decl.symbol.id.toString();
161593 if (!exposedVariableSymbolSet.has(idString)) {
161594 exposedVariableDeclarations.push(decl);
161595 exposedVariableSymbolSet.set(idString, true);
161596 }
161597 }
161598 else {
161599 // CONSIDER: this includes binding elements, which we could
161600 // expose in the same way as variables.
161601 firstExposedNonVariableDeclaration = firstExposedNonVariableDeclaration || decl;
161602 }
161603 }
161604 }
161605 ts.forEachChild(node, checkForUsedDeclarations);
161606 }
161607 /**
161608 * Return the symbol referenced by an identifier (even if it declares a different symbol).
161609 */

Callers

nothing calls this directly

Calls 9

isReadonlyArrayFunction · 0.85
forEachChildMethod · 0.80
findMethod · 0.65
hasMethod · 0.65
indexOfMethod · 0.45
toStringMethod · 0.45
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…