crabviz icon indicating copy to clipboard operation
crabviz copied to clipboard

Issues with Anonymous Functions, Const Declarations, and Class Inheritance in TS/JS

Open mxyhi opened this issue 11 months ago • 1 comments

In TypeScript/JavaScript, anonymous functions don't work, and the same goes for functions declared with 'const'. Also, class extension ('extends') inheriting methods from a base class doesn't work. image image 👇But the following code snippet below fails to be recognized correctly. image

mxyhi avatar Apr 01 '24 05:04 mxyhi

Currently, Crabviz analyzes calling relationships of three kinds of symbols: function, method, and constructor. And anonymous functions in JS/TS are marked as variables (You can check symbol kinds in the outline panel), which are filtered out, so you don't see them in the call graph.

Analyzing calling relationships of variables makes no sense in most cases, but I think we can do it in some cases for some languages, will try it later.

class extension ('extends') inheriting methods from a base class doesn't work.

I don't quite get it, could you provide some examples or explanations?

chanhx avatar Apr 01 '24 09:04 chanhx