Graph view for `@kind graph` queries by hvitved · Pull Request #705 · github/vscode-codeql

This has been invaluable for me in my recent work debugging a QL regex parser, although it does get quite unwieldy with large graphs. Something more interactive that lets you collapse subtrees would be amazing.

If this does become the basis for a released feature, I should note that I've found a few issues:

  • backslashes in node names are not rendered – it's possible some escaping is required
  • the area of the window in which the graph is rendered does not seem to fill the available space – see screenshot below, where I zoomed in to demonstrate
  • it seems to use the semmle.order property on the nodes predicate, rather than edges, to decide on the order in which child nodes are rendered, contrary to my expectations
  • at one point I managed to produce a graph query that would cause the query results windows to be completely empty (i.e. not even showing the metadata header). After that, even running non-graph queries would not fix it, and I had to restart VS Code. I'm afraid I don't know how to reproduce this now.

image