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

Function getSymbolReferencedByIdentifier

test/fixtures/snapshot/typescript.js:161610–161616  ·  view source on GitHub ↗

* Return the symbol referenced by an identifier (even if it declares a different symbol).

(identifier)

Source from the content-addressed store, hash-verified

161608 * Return the symbol referenced by an identifier (even if it declares a different symbol).
161609 */
161610 function getSymbolReferencedByIdentifier(identifier) {
161611 // If the identifier is both a property name and its value, we're only interested in its value
161612 // (since the name is a declaration and will be included in the extracted range).
161613 return identifier.parent && ts.isShorthandPropertyAssignment(identifier.parent) && identifier.parent.name === identifier
161614 ? checker.getShorthandAssignmentValueSymbol(identifier.parent)
161615 : checker.getSymbolAtLocation(identifier);
161616 }
161617 function tryReplaceWithQualifiedNameOrPropertyAccess(symbol, scopeDecl, isTypeNode) {
161618 if (!symbol) {
161619 return undefined;

Callers 2

recordUsagebySymbolFunction · 0.85
checkForUsedDeclarationsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected