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

**URL:** https://discourse.julialang.org/t/neovim-coc-incorrect-missing-reference-warnings-with-installed-packages/73126
**Category:** Tooling
**Tags:** neovim
**Created:** [December 15, 2021, 9:43am UTC](https://discourse.julialang.org/t/neovim-coc-incorrect-missing-reference-warnings-with-installed-packages/73126 "2021-12-15T09:43:25Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![iago-lito](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iago-lito/32/31924_2.png) [@iago-lito](https://discourse.julialang.org/u/iago-lito)
#### Post date: [December 15, 2021, 9:43am UTC](https://discourse.julialang.org/t/neovim-coc-incorrect-missing-reference-warnings-with-installed-packages/73126/1 "2021-12-15T09:43:25Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![originalsouth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/originalsouth/32/32061_2.png) [@originalsouth](https://discourse.julialang.org/u/originalsouth)
#### Post date: [December 15, 2021, 11:49am UTC](https://discourse.julialang.org/t/neovim-coc-incorrect-missing-reference-warnings-with-installed-packages/73126/2 "2021-12-15T11:49:37Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![iago-lito](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iago-lito/32/31924_2.png) [@iago-lito](https://discourse.julialang.org/u/iago-lito)
#### Post date: [December 16, 2021, 8:15am UTC](https://discourse.julialang.org/t/neovim-coc-incorrect-missing-reference-warnings-with-installed-packages/73126/3 "2021-12-16T08:15:12Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![originalsouth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/originalsouth/32/32061_2.png) [@originalsouth](https://discourse.julialang.org/u/originalsouth)
#### Post date: [December 16, 2021, 9:03am UTC](https://discourse.julialang.org/t/neovim-coc-incorrect-missing-reference-warnings-with-installed-packages/73126/4 "2021-12-16T09:03:14Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![iago-lito](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iago-lito/32/31924_2.png) [@iago-lito](https://discourse.julialang.org/u/iago-lito)
#### Post date: [December 17, 2021, 8:54am UTC](https://discourse.julialang.org/t/neovim-coc-incorrect-missing-reference-warnings-with-installed-packages/73126/5 "2021-12-17T08:54:07Z")

</div>

Hm, still no luck ☹

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?

```julia
$ /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.)

---

<div class="post-metadata">

### Author: ![originalsouth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/originalsouth/32/32061_2.png) [@originalsouth](https://discourse.julialang.org/u/originalsouth)
#### Post date: [December 21, 2021, 7:15am UTC](https://discourse.julialang.org/t/neovim-coc-incorrect-missing-reference-warnings-with-installed-packages/73126/6 "2021-12-21T07:15:05Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![iago-lito](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iago-lito/32/31924_2.png) [@iago-lito](https://discourse.julialang.org/u/iago-lito)
#### Post date: [February 23, 2022, 1:55pm UTC](https://discourse.julialang.org/t/neovim-coc-incorrect-missing-reference-warnings-with-installed-packages/73126/7 "2022-02-23T13:55:29Z")

</div>

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