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

Add annotation type autodetection #116

Merged
merged 7 commits into from
Jan 3, 2023
Merged

Conversation

ssiyad
Copy link
Contributor

@ssiyad ssiyad commented Nov 14, 2022

ref: #74

Creates a new generate() type, `any`, which contextually adds an
annotation by whichever matching type is first found in the tree around
the cursor.

So, if your cursor is in a function, it will annotate the function, if
in a class or struct definition, it'll annotate that, etc.

Co-authored-by: Sabu Siyad <hello@ssiyad.com>
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
@danymat
Copy link
Owner

danymat commented Nov 14, 2022

Hello, I had a quick look at the PR and thank you for your proposition !
I will need to actually try it and make some tests before merging.

One small thing though, i prefer func to stay the default generating method. The any method can be configured + passed in :Neogen ... call. Users will not see any regression, and we can discuss a bit more if users want to make it default.

@ssiyad
Copy link
Contributor Author

ssiyad commented Nov 15, 2022

I'd prefer any as default because it makes every type available out of the box. It will be far better than having multiple keybindings for each type. It will also eliminate the need of using type= for most users. Backward compatibility is a valid point, but any as default makes more sense

@danymat
Copy link
Owner

danymat commented Nov 15, 2022

I agree, then the semver version will need to update the major, because of possible backwards compatibility. I'm adding this to the commit

@ssiyad
Copy link
Contributor Author

ssiyad commented Nov 17, 2022

@danymat cool. is there anything else I can help with, related to this PR?

Copy link
Owner

@danymat danymat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I reviewed the code responsible for autodetection.
Sorry for the delay, life has been complicated these last months.
Thank's a lot for your PR, ping me for anything !
Regards

doc/neogen.txt Show resolved Hide resolved
lua/neogen/generator.lua Show resolved Hide resolved
lua/neogen/generator.lua Outdated Show resolved Hide resolved
lua/neogen/generator.lua Outdated Show resolved Hide resolved
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
@danymat danymat merged commit 9a2ada8 into danymat:main Jan 3, 2023
@danymat
Copy link
Owner

danymat commented Jan 3, 2023

Hello,
Thanks a lot for your modifications, I added some info about the new version and released it with tags. Thank your for bringing neogen to 2.11 🥳 ❤️

@ssiyad
Copy link
Contributor Author

ssiyad commented Jan 3, 2023

The honour is all mine. Thank you!

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

Successfully merging this pull request may close these issues.

3 participants