coc-julia icon indicating copy to clipboard operation
coc-julia copied to clipboard

Numerous "Missing reference" warnings even with `"julia.lint.missingrefs": false`.

Open iago-lito opened this issue 3 years ago • 5 comments

For instance with this in coc-settings.json:

    "julia.environmentPath": ".",
    "julia.lint.missingrefs": false,

and the following simple file:

using Revise             Missing reference: Revise

Although using Revise yields no error in a REPL opened in the same folder.

iago-lito avatar Sep 16 '21 08:09 iago-lito

Maybe Revise is not part of your Project.toml but only available through some other environment in the stack?

lassepe avatar Sep 16 '21 08:09 lassepe

@lassepe Hm, in this case, would the repl not error when I try using Revise? Anyway, the message still appears on whatever reference I use from my local package. Does the julia LSP server actually activates my current environment?

(I'm still struggling to construct a mwe, because I'm not familiar with Julia yet.)

iago-lito avatar Sep 16 '21 09:09 iago-lito

I can reproduce with a fresh package:

In an empty folder:

$ julia
julia> using PkgSkeleton
julia> PkgSkeleton.generate("empty_package")
...
successfully generated empty_package

then cd empty_package and setup src/empty_packages.jl

module empty_package

function f()
    println("Hey")
end

end # module

then when editing empty_package/main.jl

using empty_package         Missing reference: empty_package

empty_package.f()           Missing reference: empty_package

iago-lito avatar Sep 16 '21 09:09 iago-lito

coc-nvim should activate the current project. But for that to work you need to be inside the directory I belief. Did you launch nvim within empty_package in your example above?

lassepe avatar Sep 16 '21 09:09 lassepe

Yeah, I was within empty_package folder and opened file with nvim main.jl.

iago-lito avatar Sep 16 '21 10:09 iago-lito

Closing as I cannot reproduce anymore :)

iago-lito avatar Dec 07 '22 14:12 iago-lito