-
-
Notifications
You must be signed in to change notification settings - Fork 802
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
Show hint to import unqualified types/values #4297
Comments
Good idea! Perhaps we could look for a type constructor with the appropriate arity, favouring imported modules over unimported ones? |
I've been meaning to try and tackle this and, just so that its clear, I just need to add the hint to the error output for now, or should I implement a code action too? |
Also, should I hint to qualify it or import unqualified? |
Probably hint to qualify it. No code action needed for now, although if you want to integrate the code action, feel free |
Just when I publish a draft to import unqualified (as I suppose that is the programmer's original intention) 😄 |
That's fine. I don't have a strong opinion either way |
When you say value, do you mean a public constant, function and/or type constructor? |
Yep |
For example:
This is an error, since
Dict
is not imported. However,gleam/dict
is. So we could either give a hint to import it unqualified:gleam/dict.{type Dict}
, or (probably preferably), qualify it:dict.Dict(...)
We could either just check for this in imported modules, or all importable modules.
The text was updated successfully, but these errors were encountered: