# Problem with coc vim and julia server (MacOS)

**URL:** https://discourse.julialang.org/t/problem-with-coc-vim-and-julia-server-macos/89512
**Category:** Tooling
**Tags:** vim, neovim
**Created:** [October 30, 2022, 4:39am UTC](https://discourse.julialang.org/t/problem-with-coc-vim-and-julia-server-macos/89512 "2022-10-30T04:39:47Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![indymnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/indymnv/32/212594_2.png) [@indymnv](https://discourse.julialang.org/u/indymnv)
#### Post date: [October 30, 2022, 4:39am UTC](https://discourse.julialang.org/t/problem-with-coc-vim-and-julia-server-macos/89512/1 "2022-10-30T04:39:47Z")

</div>

I tried to add an autocompletion for vim but the language server crashed every time i open a julia file, this is the error i got when i open:CocInfo

```julia
## versions

vim version: NVIM v0.7.0
node version: v18.11.0
coc.nvim version: 0.0.82-86e85b4f 2022-10-30 01:56:13 +0800
coc.nvim directory: /Users/indynavarro/.vim/plugged/coc.nvim
term: iTerm.app
platform: darwin

## Log of coc.nvim

2022-10-30T09:06:11.155 INFO (pid:40290) [plugin] - coc.nvim initialized with node: v18.11.0 after 1013ms
2022-10-30T09:06:11.574 INFO (pid:40290) [services] - LanguageClient Julia Language Server state change: stopped => starting
2022-10-30T09:06:11.578 INFO (pid:40290) [language-client-index] - Language server "julia" started with 40303
2022-10-30T09:06:13.825 INFO (pid:40290) [services] - LanguageClient Julia Language Server state change: starting => stopped
2022-10-30T09:06:13.825 INFO (pid:40290) [services] - LanguageClient Julia Language Server state change: stopped => starting
2022-10-30T09:06:13.826 ERROR (pid:40290) [language-client-client] - Server julia initialization failed. Eg [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:50:4562)
    at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:246:114125)
    at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10970)
    at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:255:3551)
    at t (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10622)
    at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
    at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230)
    at Le (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:24:6501)
    at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
    at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230) {
  code: -32097,
  data: undefined
}
2022-10-30T09:06:13.826 INFO (pid:40290) [services] - LanguageClient Julia Language Server state change: starting => stopped
2022-10-30T09:06:13.827 ERROR (pid:40290) [server] - unhandledRejection Promise {
  <rejected> Eg [Error]: Pending response rejected since connection got disposed
      at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:50:4562)
      at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:246:114125)
      at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10970)
      at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:255:3551)
      at t (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10622)
      at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
      at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230)
      at Le (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:24:6501)
      at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
      at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230) {
    code: -32097,
    data: undefined
  }
} Eg [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:50:4562)
    at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:246:114125)
    at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10970)
    at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:255:3551)
    at t (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10622)
    at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
    at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230)
    at Le (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:24:6501)
    at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
    at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230) {
  code: -32097,
  data: undefined
}
2022-10-30T09:06:13.827 ERROR (pid:40290) [server] - unhandledRejection Promise { <rejected> undefined } undefined
2022-10-30T09:06:13.829 INFO (pid:40290) [language-client-index] - Language server "julia" started with 40306
2022-10-30T09:06:15.967 INFO (pid:40290) [services] - LanguageClient Julia Language Server state change: stopped => starting
2022-10-30T09:06:15.967 ERROR (pid:40290) [language-client-client] - Server julia initialization failed. Eg [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:50:4562)
    at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:246:114125)
    at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10970)
    at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:255:3551)
    at t (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10622)
    at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
    at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230)
    at Le (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:24:6501)
    at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
    at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230) {
  code: -32097,
  data: undefined
}
2022-10-30T09:06:15.967 INFO (pid:40290) [services] - LanguageClient Julia Language Server state change: starting => stopped
2022-10-30T09:06:15.967 ERROR (pid:40290) [services] - Server julia failed to start: Eg [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:50:4562)
    at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:246:114125)
    at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10970)
    at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:255:3551)
    at t (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10622)
    at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
    at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230)
    at Le (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:24:6501)
    at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
    at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230) {
  code: -32097,
  data: undefined
}
2022-10-30T09:06:15.968 ERROR (pid:40290) [server] - unhandledRejection Promise { <rejected> undefined } undefined
2022-10-30T09:06:15.968 INFO (pid:40290) [language-client-index] - Language server "julia" started with 40309
2022-10-30T09:06:18.098 INFO (pid:40290) [services] - LanguageClient Julia Language Server state change: stopped => starting
2022-10-30T09:06:18.098 ERROR (pid:40290) [language-client-client] - Server julia initialization failed. Eg [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:50:4562)
    at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:246:114125)
    at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10970)
    at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:255:3551)
    at t (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10622)
    at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
    at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230)
    at Le (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:24:6501)
    at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
    at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230) {
  code: -32097,
  data: undefined
}
2022-10-30T09:06:18.098 INFO (pid:40290) [services] - LanguageClient Julia Language Server state change: starting => stopped
2022-10-30T09:06:18.099 ERROR (pid:40290) [server] - unhandledRejection Promise { <rejected> undefined } undefined
2022-10-30T09:06:18.099 INFO (pid:40290) [language-client-index] - Language server "julia" started with 40312
2022-10-30T09:06:20.294 ERROR (pid:40290) [language-client-client] - Server julia initialization failed. Eg [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:50:4562)
    at Object.dispose (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:246:114125)
    at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10970)
    at Th.handleConnectionClosed (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:255:3551)
    at t (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:251:10622)
    at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
    at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230)
    at Le (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:24:6501)
    at MP.invoke (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:14460)
    at Yc.fire (/Users/indynavarro/.vim/plugged/coc.nvim/build/index.js:23:15230) {
  code: -32097,
  data: undefined
}
2022-10-30T09:06:20.295 ERROR (pid:40290) [server] - unhandledRejection Promise { <rejected> undefined } undefined
2022-10-30T09:06:36.855 INFO (pid:40290) [attach] - receive notification: showInfo []

```

My .vimrc is pretty basic (I guess), only julia formatter, julia vim, coc-julia, coc.nvim and some extras like nerdtree, slime and so on.

Any idea what could be the problem?

---

<div class="post-metadata">

### Author: ![Y.S\_Chu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/y.s_chu/32/44532_2.png) [@Y.S\_Chu](https://discourse.julialang.org/u/Y.S_Chu)
#### Post date: [November 21, 2022, 4:18pm UTC](https://discourse.julialang.org/t/problem-with-coc-vim-and-julia-server-macos/89512/2 "2022-11-21T16:18:25Z")

</div>

use PackageCompiler.jl to compile a sysimage of LanguageServer.jl.  
:CocCommand julia.CompileLanguageServerSysimg  
You may have to install PackageCompiler if not exists.(Pkg.add)

---

<div class="post-metadata">

### Author: ![indymnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/indymnv/32/212594_2.png) [@indymnv](https://discourse.julialang.org/u/indymnv)
#### Post date: [November 22, 2022, 9:57am UTC](https://discourse.julialang.org/t/problem-with-coc-vim-and-julia-server-macos/89512/3 "2022-11-22T09:57:02Z")

</div>

I tried to run `:CocCommand julia.CompileLanguageServerSysimg` after installing PackageCompiler, but I got this

```julia
[coc.nvim]: Error on notification "runCommand": Command: julia.CompileLanguageSer
verSysimg not found

```

I was following a few weeks ago these [instructions](https://discourse.julialang.org/t/neovim-languageserver-jl/37286/82), and I uninstalled the coc-julia (because they didn’t mention installing it in the forum). My concern now, is I am getting missing references in different parts of the code. Like this one.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/9/69b2ad2315b65a9201052226fdc4ca9c08ab6943.jpeg)

So I am still stuck with these hahah 😄

---

<div class="post-metadata">

### Author: ![AugustoCL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/augustocl/32/32022_2.png) [@AugustoCL](https://discourse.julialang.org/u/AugustoCL)
#### Post date: [July 1, 2023, 12:40am UTC](https://discourse.julialang.org/t/problem-with-coc-vim-and-julia-server-macos/89512/4 "2023-07-01T00:40:59Z")

</div>

I’m facing exactly the same problem.

Did you got any updates about it?

---

<div class="post-metadata">

### Author: ![indymnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/indymnv/32/212594_2.png) [@indymnv](https://discourse.julialang.org/u/indymnv)
#### Post date: [July 1, 2023, 1:57am UTC](https://discourse.julialang.org/t/problem-with-coc-vim-and-julia-server-macos/89512/5 "2023-07-01T01:57:50Z")

</div>

Hi!, I solved this problem by going on another path. Now I am using Neovim and instead of COC, I am using the LSP. I am not sure if it’s useful for you, but this was my process.

1. Install Neovim
2. Created an init.lua and just keep simple using the [kick starter](https://github.com/nvim-lua/kickstart.nvim), which consider the most basic stuff to use.
3. In the init.lua also I added julia for the [treesitter](https://github.com/nvim-lua/kickstart.nvim/blob/master/init.lua#L309) and the julials = {} for [localservers](https://github.com/nvim-lua/kickstart.nvim/blob/master/init.lua#L427)
4. Finally, to set up the language server protocol, you will need to create the sysimage, you can follow the instructions considering in this [discussion](https://discourse.julialang.org/t/neovim-languageserver-jl/37286/83?page=5)
5. With that should be enough, and you can consider adding other stuffs you need like vim-slime for example.

Finally, if you open a Julia file it should take a few seconds to prepare the lsp and you can start working with that.

Hope that can help you.

---

<div class="post-metadata">

### Author: ![anand.kumar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/anand.kumar/32/206982_2.png) [@anand.kumar](https://discourse.julialang.org/u/anand.kumar)
#### Post date: [March 20, 2024, 4:38pm UTC](https://discourse.julialang.org/t/problem-with-coc-vim-and-julia-server-macos/89512/6 "2024-03-20T16:38:23Z")

</div>

Works for me. Launch Julia in the specific project `\usr\bin\julia project=.config/coc/extensions/node_modules/coc-julia/server`. Then check if `LanguageServer.jl` package is installed : `Pkg.status()`.

In my case it was there but not downloaded so I ran `Pkg.instantiate()` to download it and worked. You’ll be prompted to run `Pkg.instantiate()` all packages are not downloaded. run it anyway and might work.

Although I also had installed `PackageCompiler.jl` but didn’t need to do anything with this.
