Problem with coc vim and julia server (MacOS)

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

## 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?

1 Like

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

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

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

I was following a few weeks ago these instructions, 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.

So I am still stuck with these hahah :smile:

I’m facing exactly the same problem.

Did you got any updates about it?

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, which consider the most basic stuff to use.
  3. In the init.lua also I added julia for the treesitter and the julials = {} for localservers
  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
  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.

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.