Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto resolve annotation type #87

Closed
asmodeus812 opened this issue Apr 5, 2022 · 8 comments
Closed

Auto resolve annotation type #87

asmodeus812 opened this issue Apr 5, 2022 · 8 comments
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@asmodeus812
Copy link

asmodeus812 commented Apr 5, 2022

Hi, great plugin that has little to be desired. One question though, and maybe I am probably missing something, but i don't seem to understand why when not specifying arguments to neogen generate will automatically fallback to func instead of trying to guess the current node the cursor is on. For example when i am on a class or a field or a function. As it is now users are required to have multiple key bindings for different node types. I was testing with java. Is it possible, using tree sitter to properly resolve the current symbol/node the cursor is on and then use that internally when calling generate ?

Another suggestion, file type scope, either deduced automatically or manually, it would be great if you could generate comments for all symbols in the current file (that are supported for the specific language)
And one more, visual selection - selecting multiple symbols (say functions inside a class) for example and doing Neogen.

@danymat
Copy link
Owner

danymat commented Apr 5, 2022

Hello ! Thanks for your feedback !

Hi, great plugin that has little to be desired. One question though, and maybe I am probably missing something, but i don't seem to understand why when not specifying arguments to neogen generate will automatically fallback to func instead of trying to guess the current node the cursor is on. For example when i am on a class or a field or a function. As it is now users are required to have multiple key bindings for different node types. I was testing with java. Is it possible, using tree sitter to properly resolve the current symbol/node the cursor is on and then use that internally when calling generate ?

I think you are proposing something like: #74 is it ?

Another suggestion, file type scope, either deduced automatically or manually, it would be great if you could generate comments for all symbols in the current file (that are supported for the specific language)
And one more, visual selection - selecting multiple symbols (say functions inside a class) for example and doing Neogen

For these, i'm not sure: i think that the focus in neogen is doing one thing, and doing it well. If we start to add subtelties to neogen capabilities (like visually select before doing Neogen), it'll be hard for users to know what Neogen will do.
The principle is that users should know before even typing the command, what the command will do in terms of generation

@danymat danymat added duplicate This issue or pull request already exists enhancement New feature or request labels Apr 5, 2022
@asmodeus812
Copy link
Author

@danymat Hi, yes, this is the same idea. I see that there is a PR for it already, did not see that earlier, sorry for the duplicate.
As for the visual select, i myself see it as a natural extension to what already exists i.e bringing the ability to document multiple symbols instead of doing it one by one.
The most common case when documenting is to want to document most, usually all public api methods in any language for a given class or "scope".
The file scope is probably not that important if visual select doc is a thing.

@danymat
Copy link
Owner

danymat commented Apr 6, 2022

I prefer having a command called 'Neogen all_file' (or smt like that) to do on file scope. But the problem is that Neogen is not written with this idea in mind, and i guess it'll be very complicated to find every relevant node

@danymat
Copy link
Owner

danymat commented Oct 17, 2022

Hello, I'm getting back to coding
Is this feature still wanted ?

@asmodeus812
Copy link
Author

Hi, upon further inspection, yes, at least the possibility to comment different types of nodes. For example as i mentioned above, when the cursor is on a class, function, struct, property etc. Also as an obvious extension to this an improvement can be added for when visual selection is active, to comment out nodes within the selection (if there are valid ones in the current visual selection)

@danymat
Copy link
Owner

danymat commented Oct 17, 2022

Right now neogen provides documentation depending of what you request (neogen func, neogen class)
Is it what you're referring to in the last message ?

@danymat
Copy link
Owner

danymat commented Dec 30, 2022

Related: #30, #116

@danymat
Copy link
Owner

danymat commented Jan 9, 2023

Hello, this feature is now available on Neogen 2.11 ! (#116 )

@danymat danymat closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants