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

Function getSymbolAtLocationForQuickInfo

test/fixtures/snapshot/typescript.js:166254–166264  ·  view source on GitHub ↗
(node, checker)

Source from the content-addressed store, hash-verified

166252 return undefined;
166253 }
166254 function getSymbolAtLocationForQuickInfo(node, checker) {
166255 var object = getContainingObjectLiteralElement(node);
166256 if (object) {
166257 var contextualType = checker.getContextualType(object.parent);
166258 var properties = contextualType && getPropertySymbolsFromContextualType(object, checker, contextualType, /*unionSymbolOk*/ false);
166259 if (properties && properties.length === 1) {
166260 return ts.first(properties);
166261 }
166262 }
166263 return checker.getSymbolAtLocation(node);
166264 }
166265 /** Gets all symbols for one property. Does not get symbols for every property. */
166266 /* @internal */
166267 function getPropertySymbolsFromContextualType(node, checker, contextualType, unionSymbolOk) {

Callers 1

getQuickInfoAtPositionFunction · 0.85

Calls 3

firstMethod · 0.45

Tested by

no test coverage detected