You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, digging into the source for nvim-treesitter-context, I can see an API require('treesitter-context.context').get(bufnr, winnr). I've played with this and can see that it returns the context information as expected and indeed that nvim-treesitter-context obviously uses it for this too.
I'd be really interested in reusing this API in my own plugin debugprint.nvim. debugprint allows the user to add 'poor man' debugging statements into their own code easily. I'd love to offer the option to add context information to help the user correlate the output generated from that with their code, but that's hard to do in a generic sense.
I can see that you've put a lot of the hard effort into supporting this for a variety of languages here, and it would be great to reuse that by making nvim-treesitter-context a soft dependency which allows debugprint to add that information via the API. However, I really only want to do that if you were interested in (at least) semi-formalizing that API by documenting it and keeping it at least reasonably stable.
Is this something you'd be interested in? If you like the principle but don't have the time, I'd be happy to work on a pull request for nvim-treesitter-context to list it out in the README and 'document' it that way - that'd probably be sufficient for my purposes. Thanks.
The text was updated successfully, but these errors were encountered:
Sounds reasonable, only requires the API to stay stable so there's no effort beyond documenting it. I don't see the implementation needing a substantial refactor anytime soon, so it should stay stable. Feel free to open a PR. Ping @lewis6991, if you have any objection.
I think this can be closed. I realized this isn't practical for my purposes at least; nvim-treesitter-context is not a generalized "get me the context of where I'm sitting in my code" breadcrumbing tool; the logic of what's in view is also deeply ingrained. I don't want to untangle this too deeply and it could be too complex.
Description
Hi, digging into the source for
nvim-treesitter-context
, I can see an APIrequire('treesitter-context.context').get(bufnr, winnr)
. I've played with this and can see that it returns the context information as expected and indeed thatnvim-treesitter-context
obviously uses it for this too.I'd be really interested in reusing this API in my own plugin debugprint.nvim.
debugprint
allows the user to add 'poor man' debugging statements into their own code easily. I'd love to offer the option to add context information to help the user correlate the output generated from that with their code, but that's hard to do in a generic sense.I can see that you've put a lot of the hard effort into supporting this for a variety of languages here, and it would be great to reuse that by making
nvim-treesitter-context
a soft dependency which allowsdebugprint
to add that information via the API. However, I really only want to do that if you were interested in (at least) semi-formalizing that API by documenting it and keeping it at least reasonably stable.Is this something you'd be interested in? If you like the principle but don't have the time, I'd be happy to work on a pull request for
nvim-treesitter-context
to list it out in the README and 'document' it that way - that'd probably be sufficient for my purposes. Thanks.The text was updated successfully, but these errors were encountered: