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

Function definitionFromType

test/fixtures/snapshot/typescript.js:139893–139897  ·  view source on GitHub ↗
(type, checker, node, failedAliasResolution)

Source from the content-addressed store, hash-verified

139891 }
139892 GoToDefinition.getTypeDefinitionAtPosition = getTypeDefinitionAtPosition;
139893 function definitionFromType(type, checker, node, failedAliasResolution) {
139894 return ts.flatMap(type.isUnion() && !(type.flags & 32 /* TypeFlags.Enum */) ? type.types : [type], function (t) {
139895 return t.symbol && getDefinitionFromSymbol(checker, t.symbol, node, failedAliasResolution);
139896 });
139897 }
139898 function tryGetReturnTypeOfFunction(symbol, type, checker) {
139899 // If the type is just a function's inferred type,
139900 // go-to-type should go to the return type instead, since go-to-definition takes you to the function anyway.

Callers 1

Calls 2

getDefinitionFromSymbolFunction · 0.85
flatMapMethod · 0.80

Tested by

no test coverage detected