How can I find which functions are being called by which functions with ts-morph or the typescript compiler API?

293 Views Asked by At

Using ts-morph, we can get function declarations in a source file by calling sourceFile.getFunctions().

Calling functionDeclaration.getChildrenOfKind(SyntaxKind.CallExpression) on function declarations then lets us find all function calls in the body of the corresponding functions.

What I'm missing is - how can I find the function declarations corresponding to the functions being called in the call expressions?

0

There are 0 best solutions below