neogen icon indicating copy to clipboard operation
neogen copied to clipboard

Auto resolve annotation type

Open asmodeus812 opened this issue 3 years ago • 3 comments

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.

asmodeus812 avatar Apr 05 '22 08:04 asmodeus812

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 avatar Apr 05 '22 11:04 danymat

@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.

asmodeus812 avatar Apr 05 '22 14:04 asmodeus812

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 avatar Apr 06 '22 08:04 danymat

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

danymat avatar Oct 17 '22 10:10 danymat

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)

asmodeus812 avatar Oct 17 '22 11:10 asmodeus812

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 avatar Oct 17 '22 11:10 danymat

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 avatar Oct 17 '22 11:10 danymat

Related: #30, #116

danymat avatar Dec 30 '22 12:12 danymat

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

danymat avatar Jan 09 '23 13:01 danymat