godbolt.nvim icon indicating copy to clipboard operation
godbolt.nvim copied to clipboard

Feature Request: optional new window with clang-query output

Open mellery451 opened this issue 1 year ago • 3 comments

godbolt has an optional clang-query output and it would be handy to optionally open a window with that info locally.

mellery451 avatar Aug 13 '24 20:08 mellery451

How do I use this? https://godbolt.org/z/a17GYf6Kz, I tried the instructions on https://firefox-source-docs.mozilla.org/code-quality/static-analysis/writing-new/clang-query.html

p00f avatar Aug 14 '24 04:08 p00f

in the tool input window, enter something like this:

 set output dump
 m translationUnitDecl()

Obviously there are lots of queries one could do...and I guess that would be one trick (allowing users to specify/customize the tool input)..but starting with just the dump of the TU would be cool

https://godbolt.org/z/EaY8KbjqW

mellery451 avatar Aug 14 '24 18:08 mellery451

For just printing the AST you can another plugin of mine https://github.com/p00f/clangd_extensions.nvim?tab=readme-ov-file#view-ast

This will be much faster because it's local, and it has live highlighting of nodes/subtrees

Re: other uses I need to think on how to take query input

p00f avatar Aug 14 '24 18:08 p00f