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

ExplicitExports always suggests exporting from the "defining" module #24

Closed
ericphanson opened this issue Mar 3, 2024 · 1 comment · Fixed by #25
Closed

ExplicitExports always suggests exporting from the "defining" module #24

ericphanson opened this issue Mar 3, 2024 · 1 comment · Fixed by #25

Comments

@ericphanson
Copy link
Owner

because:

julia> module M
       using StaticArrays
       end
Main.M

julia> Base.which(M, :StaticVector)
StaticArraysCore

so if you use StaticVector, we suggest using StaticArraysCore: StaticVector rather than using StaticArrays: StaticVector.

In some cases folks would prefer to get the outermost suggestion, xref JuliaStats/MixedModels.jl#748 (comment).

@ericphanson
Copy link
Owner Author

Not 100% sure what the best semantics here. Definitely seems suboptimal to require folks to add new deps...

I guess what we want is all the suggestions to come from the modules that have implicit imports, so we are just switching implicit to explicit. I think we should have a name => [exporting_modules] dict (which find_implicit_imports could return), and then instead of resolving names via which directly, we could check which of the modules that provides a given name resolves to the same binding as the one in the actual module does, and then print that exporting module rather than the "source module".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant