Neovim + coc : incorrect "Missing reference" warnings with installed packages

I’m very happy with coc-julia extension to enjoy julia’s LSP with neovim, except that I keep getting these annoying “Missing reference” warnings any time I add using Package, or Package.function. How do I get this right, and show the server where my installed packages are?

That should have been fixed a while ago, as far as I am aware. Are you sure you are running the newest version (:CocUpdate) with a precompiled environment?

Well, I am sure about the :PlugUpgrade, :PlugUpdate then :CocUpdate thing, but not about the “precompiled environment”… what is this and how do I get it?

The first time you run coc-julia you will get some query to install and precompile the julia backend environment for the plugin – perhaps it is outdated/corrupted somehow? Try checking it out in ~/.config/coc/extensions/node_modules/coc-julia/server/.

Worst case, you can probably delete it (back it up) and it will set itself up again.

Alternatively, you can try making a compiled environment (which also runs faster) with julia.CompileLanguageServerSysimg, this will also initiate an environment update.

Hm, still no luck :frowning:

I have :CocUninstall coc-julia, deactivated Plug 'kdheepak/JuliaFormatter.vim' (just in case), and removed everything julia-related in ~/.config/coc/extensions.

I then ran :CocInstall coc-julia again, and issued :CocCommand julia.CompileLanguageServerSysimg. It took a couple of minuts to compile… but I’m still seeing undesired “MissingRef” lints whenever I write using Plots or using Infiltrate

I had a couple of warnings during compilation, could this help narrowing my problem down?

$ /usr/bin/julia --project=/home/iago-lito/.config/coc/extensions/node_modules/coc-julia/
server/compile_env /home/iago-lito/.config/coc/extensions/node_modules/coc-julia/server/com
pile_env/compile.jl -s /home/iago-lito/.config/coc/extensions/node_modules/coc-julia/server
/JuliaLS /home/iago-lito/.config/coc/extensions/coc-julia-data/sysimg                      
[ Info: Building a sysimage for the environment '/home/iago-lito/.config/coc/extensions/node_modules/coc-julia/server/JuliaLS' to '/home/iago-lito/.config/coc/extensions/coc-julia-data/sysimg'.                                                                                
┌ Warning: The active manifest file is an older format with no julia version entry. Dependencies may have been resolved with a different julia version.                               
└ @ ~/.config/coc/extensions/node_modules/coc-julia/server/JuliaLS/Manifest.toml:0         
┌ Warning: The active manifest file is an older format with no julia version entry. Dependencies may have been resolved with a different julia version.                               
└ @ ~/.config/coc/extensions/node_modules/coc-julia/server/JuliaLS/Manifest.toml:0         
Precompiling project...                                                                    
  1 dependency successfully precompiled in 2 seconds (14 already precompiled)              
✔ [03m:15s] PackageCompiler: compiling incremental system image

(This Arch linux speaking, with neovim v0.6.0, julia v1.7.0, node v17.2.0 and coc v0.0.80-03c9add7cd.)

Weird, I am running the exact same OS and I am not running into this issue… I am not sure what goes wrong. Perhaps @fannheyward over at GitHub can help out?

Well, the problem does not occur anymore :slight_smile: Maybe my bad was to not wait untill termination of julia process after I :CocInstall coc-julia, and leaving vim too early?