-
-
Notifications
You must be signed in to change notification settings - Fork 865
Add a qualified/unqualified import code actions for unknown values/types #4615
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
base: main
Are you sure you want to change the base?
Add a qualified/unqualified import code actions for unknown values/types #4615
Conversation
Added both a qualified and an unqualified import code action for unknown types and values
Should probably be merged after #4602, as it depends on it. |
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.
Fantastic work! Thank you! I've left a bunch of notes inline
|
||
for suggestion in suggestions { | ||
let (edits, title) = match suggestion { | ||
ModuleSuggestion::Importable(full_name) => ( |
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.
It's name
, not full_name
. The abbreviated name for a module is called an alias
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.
Might I change it to module_name
, to not conflict with name
(the type/value name)?
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.
Sounds good to me!
pub fn go() { wobble() } | ||
" | ||
); | ||
} |
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.
Could you un-indent the code and add some more test cases please 🙏
For example:
- Import statement existing but not the first statement
- Import statement already has unqualified items
- Import with no alias (
as _
) - Patterns
- Constants
- Guards
- Types with incorrect arity
- Record constructors with incorrect arity
- Long module and item names to show the error text is wrapped correctly
and any others to cover all the code paths
Most of the refactorization is done, just waiting on some clarifications @lpil |
The inline comments from the previous review haven't been addressed yet! |
Sorry for the delay 😅, I don't understand which comments I haven't addressed, besides the one about tests? |
Hey @lpil, sorry for the long delay. Things popped up and I didn't have time to work on this. Could you clarify which inline comments I haven't addressed yet? |
This PR adds both a qualified and an unqualified import code actions for both unknown values and types. Closes #4613.