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

Function inferTypeForParametersFromUsage

test/fixtures/snapshot/typescript.js:156855–156862  ·  view source on GitHub ↗
(func, sourceFile, program, cancellationToken)

Source from the content-addressed store, hash-verified

156853 return inferTypeFromReferences(program, references, cancellationToken).single();
156854 }
156855 function inferTypeForParametersFromUsage(func, sourceFile, program, cancellationToken) {
156856 var references = getFunctionReferences(func, sourceFile, program, cancellationToken);
156857 return references && inferTypeFromReferences(program, references, cancellationToken).parameters(func) ||
156858 func.parameters.map(function (p) { return ({
156859 declaration: p,
156860 type: ts.isIdentifier(p.name) ? inferTypeForVariableFromUsage(p.name, program, cancellationToken) : program.getTypeChecker().getAnyType()
156861 }); });
156862 }
156863 function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) {
156864 var searchToken;
156865 switch (containingFunction.kind) {

Callers 1

annotateParametersFunction · 0.85

Calls 4

getFunctionReferencesFunction · 0.85
inferTypeFromReferencesFunction · 0.85
mapMethod · 0.65

Tested by

no test coverage detected