Open mlthlschr opened 1 year ago
You could use tree-sitter and simply detect all classes, functions, etc.
If it is desired for the project or someone else is interested, I implemented a feature here triggering neogen for the node one line below. I am using it in combination with a keymap, so that a comment in the line above e.g. a function triggers neogen (comparable to the behavior in Jetbrains IDEs).
Seems a very cool feature. However, I fall short understand what it needs to trigger neogen for the node one line below. If you are still interested in sharing, would you mind sharing a bit more ? And why not re-work the feature a bit, and create a PR for it ?
I would like to check if it is possible to generate a comment at the current cursor position
Generating under the current cursor is possible. In fact it's needed for https://github.com/danymat/neogen/pull/201
I added integration with LuaSnip + Neogen in a separate example: https://github.com/danymat/neogen/pull/202
Being able to generate docstring code at any cursor position I think would be a welcome thing.
Hi,
I am thinking about combining neogen with the lsp code actions. For that, I would like to check if it is possible to generate a comment at the current cursor position. If there is, I would like to display an option like "Generate comment" in the code action window.
I checked the API and it looks like right now it is only possible to trigger the generation, even if it is not at the cursor position. Is that correct?
Would be great if there was a way to check that. In case thats not available and not planned I offer help with implementation, if needed.