p00f / godbolt.nvim

Display assembly for the current buffer or visual selection from godbolt.org. Use https://sr.ht/~p00f/godbolt.nvim instead
GNU General Public License v3.0
206 stars 11 forks source link

Feature Request: optional new window with clang-query output #28

Open mellery451 opened 1 month ago

mellery451 commented 1 month ago

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

p00f commented 1 month ago

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

mellery451 commented 1 month ago

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

p00f commented 1 month ago

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