tintinweb / vscode-interactive-graphviz

Interactive Graphviz Dot Preview for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=tintinweb.graphviz-interactive-preview
GNU General Public License v3.0
152 stars 26 forks source link

Complete Outline View - using dot parser lib and fallback to regex #97

Closed tintinweb closed 2 years ago

tintinweb commented 2 years ago

refs #95

image
tintinweb commented 2 years ago

wdyt @bigbug?

added a new DotParser.ts that builds a vscode symbol tree for the outline. it currently breaks other symbol functionality. just created this as a PoC. would be great to get your input on whether we want to go forward using the parser for all symbol related things. thanks!

bigbug commented 2 years ago

I think the question here is what happens on syntax errors. Is the AST stable enough to handle this as well? The regex code is very fault tolerant.

tintinweb commented 2 years ago

In another extension I am only updating the AST on file change. If the parser bails we can show it in the problem view but keep the symbol tree. It will not be super accurate but should work most of the time. I agree that we should try to gratefully parse the code and not cause too much inconvenience while typing 🙌 let's explore this and decide if we want to use the parser.

bigbug commented 2 years ago

There seems to be a problem with html elements. See example3.dot

bigbug commented 2 years ago

Current problem: The AST seems to not recognise nodes which have been defined within an edge:

Screenshot 2022-04-14 at 18 57 03
bigbug commented 2 years ago

DotParser now recognises edges and the nodes below.

tintinweb commented 2 years ago

looks good!

going to merge this in the meantime 🥳