Skip to content

Conversation

mine-tech-oficial
Copy link

This PR adds both a qualified and an unqualified import code actions for both unknown values and types. Closes #4613.

@mine-tech-oficial
Copy link
Author

Should probably be merged after #4602, as it depends on it.

Copy link
Member

@lpil lpil left a 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) => (
Copy link
Member

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

Copy link
Author

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)?

Copy link
Member

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() }
"
);
}
Copy link
Member

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

@mine-tech-oficial
Copy link
Author

Most of the refactorization is done, just waiting on some clarifications @lpil

@lpil lpil marked this pull request as draft June 16, 2025 14:00
@lpil
Copy link
Member

lpil commented Jun 25, 2025

The inline comments from the previous review haven't been addressed yet!

@mine-tech-oficial
Copy link
Author

Sorry for the delay 😅, I don't understand which comments I haven't addressed, besides the one about tests?

@mine-tech-oficial
Copy link
Author

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?

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.

Import unqualified code action
2 participants