Open IndianBoy42 opened 1 year ago
Thanks, this is a really interesting idea! I won't be able to look at this this week but will definitely pop this on the backlog for action.
similar issue: https://github.com/andrewferrier/debugprint.nvim/issues/112
Support different external plugins for doing this e.g. navic: https://github.com/PatschD/zippy.nvim
So I've looked at zippy.nvim
, and it's too flaky, as it relies on LSP attaches.
nvim-treesitter-context
is also not suitable, it looks at what's "in view" on the screen as it uses it for drawing a breadcrumb, this is not what we need.
contextprint.nvim
is too basic, dated, and relies on hardcoded TS approaches as opposed to queries.
I'm keeping this issue open, but right now I would like a simple way to do this via TS, or it's just adding too much complexity to this simple tool.
Consider doing something really crude using indentation...
OK, so indentation turns out not to be straightforward, as it's hard to account for blank lines in between blocks of code etc.
Hey! Not sure if this will help, but https://github.com/ThePrimeagen/refactoring.nvim also has some logic for detecting the class / function (at least it works for TypeScript). Should be here in the debug folder. https://github.com/ThePrimeagen/refactoring.nvim/tree/master/lua/refactoring/debug
Thanks, I'll take a look when I get a moment!
Similar to this old plugin: https://github.com/polarmutex/contextprint.nvim
You might be interested in https://github.com/SmiteshP/nvim-navic to do the work of calculating the context from lsp