At first I tried to implement it with a parser in JS, specifically with antlr4, and at the end I ran into many problems specifically with grammar, which needed to be constantly completed ... I decided to implement this using the standard AST module, I call the Python script and pass the path to source, it returns me a JSON AST, which I already parse in the extension, tried it on my projects, it works fine, I'm waiting for suggestions for improvement.
At first I tried to implement it with a parser in JS, specifically with antlr4, and at the end I ran into many problems specifically with grammar, which needed to be constantly completed ... I decided to implement this using the standard AST module, I call the Python script and pass the path to source, it returns me a JSON AST, which I already parse in the extension, tried it on my projects, it works fine, I'm waiting for suggestions for improvement.