-
-
Notifications
You must be signed in to change notification settings - Fork 669
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
Feat: add annotation LSP code action #3001
Conversation
Can't really track down that failed check, might be a problem on hex's side |
That seems to just happen sometimes lately. You can probably just make a dummy/empty commit if you wanna rerun the pipeline |
Marked as draft to clean it up a bit and add test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! I've not reviewed this fully yet but I can see it's using the type printer which is not suitable for code generation, it will output a representation that is not valid in many cases. This PR is making a printer is that is suitable: #3007
Could you split up the tests to have one test per thing being tested, and we'll need test coverage for imported types, shadowed types, used but not imported types, aliased types, qualified aliased types, and function types.
Thank you
Hi, and sounds good, once #3007 is merged I'll plug it in. And yes, I can expand the test suite as well |
Closing due to inactivity. Please feel free to reopen! Thank you |
Closes #2953. Added LSP code action to add explicit type annotations to assignments.
Closes #2954. Added LSP code action to add explicit type annotations to module functions.
This implementation is inevitably opinionated, I tried to match precedence where it exists but with only 1 other code action there wasn't much. Any changes lmk
Changes:
code_action_add_annotation
code_action_add_annotation
call in LSP enginename_if_self_is_var
toTypedPattern
inast.rs
for use in code action suggestion textfind_nodes_in_range
toModule
inbuild.rs
Implementation Details: