LanguageServer.jl
LanguageServer.jl copied to clipboard
`Missing reference` from indirect dependencies
Minimal example:
module Bar
bar() = 0
export bar
end
module Foo
using ..Bar
export bar
end
using .Foo
# using .Bar # uncommenting gets rid of the warning
bar()
For me, bar is underlined with the message Julia: Missing reference: bar.
If instead using Bar, the message goes away.
This can be annoying, as libraries importing methods, extending them, and re-exporting is common practice.
Dependent packages may only be interested in the extensions, but they're forced to also explicitly depend on the original package defining the method and using it directly from that source -- which could be viewed as an implementation detail -- to appease the language server.
The funny thing is
julia> names(Bar)
2-element Vector{Symbol}:
:Bar
:bar
julia> names(Foo)
2-element Vector{Symbol}:
:Foo
:bar
And I'd thought names was used to find the symbols.