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

Annotate all nodes in a file or ones from visual selection #187

Open
asmodeus812 opened this issue Jul 30, 2024 · 1 comment
Open

Annotate all nodes in a file or ones from visual selection #187

asmodeus812 opened this issue Jul 30, 2024 · 1 comment

Comments

@asmodeus812
Copy link

It would be great if we were to have an option in generate to scan over the entire file and all supported for annotation nodes, and annotate them at once. Another extension of this feature could be to allow for visually selecting multiple nodes and annotating them and their child nodes - e.g if one visually selects a class then the class and it's methods should be annotated.

@danymat
Copy link
Owner

danymat commented Aug 2, 2024

Hello! Neat idea.
A first example of this very same idea was created for the tests case, in order to generate all annotations at once.
The idea is to take the last one in the file, generate it, and iterate by going up.
See https://github.com/danymat/neogen/blob/main/tests/utils/textmate.lua

However, the most difficult here would be to know "where" to generate in the file.
In the tests, it knows because we put |cursor| in the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants