weirongxu / coc-kotlin

Intelligent Kotlin support for coc.nvim
MIT License
58 stars 1 forks source link

coc-kotlin no longer works #10

Closed jeremyckahn closed 1 year ago

jeremyckahn commented 1 year ago

Result from CocInfo

## versions

vim version: NVIM v0.9.0
node version: v16.15.1
coc.nvim version: 0.0.82-b7375d5f 2023-01-30 05:09:03 +0800
coc.nvim directory: /Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim
term: tmux
platform: darwin

## Log of coc.nvim

2023-04-25T17:57:53.284 WARN (pid:81749) [workspace] - workspace.createOutputChannel is deprecated, please use window.createOutputChannel instead. 
    at Object.<anonymous> (/Users/jeremykahn/.config/coc/extensions/node_modules/coc-tailwindcss/out/index.js:14:7870)
    at Generator.next (<anonymous>)
2023-04-25T17:57:53.312 INFO (pid:81749) [extension:coc-git] - Looking for git in: git
2023-04-25T17:57:53.319 INFO (pid:81749) [plugin] - coc.nvim initialized with node: v16.15.1 after 227
2023-04-25T17:57:58.248 INFO (pid:81749) [attach] - receive notification: doAutocmd [ 2, 1 ]
2023-04-25T17:57:58.456 INFO (pid:81749) [core-watchman] - watchman watching project: /Users/jeremykahn/deep6/central-api
2023-04-25T17:57:58.517 INFO (pid:81749) [attach] - receive notification: doAutocmd [ 6 ]
2023-04-25T17:57:58.870 INFO (pid:81749) [language-client-index] - Language server "kotlin" started with 81924
2023-04-25T17:57:59.144 ERROR (pid:81749) [language-client-client] - Server kotlin initialization failed. jh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:51:4592)
    at Object.dispose (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:241:6209)
    at Nd.handleConnectionClosed (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:244:15575)
    at Nd.handleConnectionClosed (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:248:3561)
    at t (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:244:15224)
    at yT.invoke (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:14460)
    at lc.fire (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:15230)
    at Qe (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:25:6504)
    at yT.invoke (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:14460)
    at lc.fire (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:15230) {
  code: -32097,
  data: undefined
}
2023-04-25T17:57:59.148 INFO (pid:81749) [language-client-index] - Language server "kotlin" started with 81934
2023-04-25T17:57:59.426 ERROR (pid:81749) [language-client-client] - Server kotlin initialization failed. jh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:51:4592)
    at Object.dispose (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:241:6209)
    at Nd.handleConnectionClosed (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:244:15575)
    at Nd.handleConnectionClosed (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:248:3561)
    at t (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:244:15224)
    at yT.invoke (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:14460)
    at lc.fire (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:15230)
    at Qe (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:25:6504)
    at yT.invoke (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:14460)
    at lc.fire (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:15230) {
  code: -32097,
  data: undefined
}
2023-04-25T17:57:59.427 ERROR (pid:81749) [server] - unhandledRejection  Promise {
  <rejected> jh [Error]: Pending response rejected since connection got disposed
      at Object.dispose (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:51:4592)
      at Object.dispose (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:241:6209)
      at Nd.handleConnectionClosed (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:244:15575)
      at Nd.handleConnectionClosed (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:248:3561)
      at t (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:244:15224)
      at yT.invoke (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:14460)
      at lc.fire (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:15230)
      at Qe (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:25:6504)
      at yT.invoke (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:14460)
      at lc.fire (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:15230) {
    code: -32097,
    data: undefined
  },
  dispose: [Function (anonymous)]
} jh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:51:4592)
    at Object.dispose (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:241:6209)
    at Nd.handleConnectionClosed (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:244:15575)
    at Nd.handleConnectionClosed (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:248:3561)
    at t (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:244:15224)
    at yT.invoke (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:14460)
    at lc.fire (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:15230)
    at Qe (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:25:6504)
    at yT.invoke (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:14460)
    at lc.fire (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:15230) {
  code: -32097,
  data: undefined
}
2023-04-25T17:57:59.430 INFO (pid:81749) [language-client-index] - Language server "kotlin" started with 81948
2023-04-25T17:57:59.703 ERROR (pid:81749) [language-client-client] - Server kotlin initialization failed. jh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:51:4592)
    at Object.dispose (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:241:6209)
    at Nd.handleConnectionClosed (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:244:15575)
    at Nd.handleConnectionClosed (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:248:3561)
    at t (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:244:15224)
    at yT.invoke (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:14460)
    at lc.fire (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:15230)
    at Qe (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:25:6504)
    at yT.invoke (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:14460)
    at lc.fire (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:15230) {
  code: -32097,
  data: undefined
}
2023-04-25T17:57:59.706 INFO (pid:81749) [language-client-index] - Language server "kotlin" started with 81957
2023-04-25T17:57:59.978 ERROR (pid:81749) [language-client-client] - Server kotlin initialization failed. jh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:51:4592)
    at Object.dispose (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:241:6209)
    at Nd.handleConnectionClosed (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:244:15575)
    at Nd.handleConnectionClosed (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:248:3561)
    at t (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:244:15224)
    at yT.invoke (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:14460)
    at lc.fire (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:15230)
    at Qe (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:25:6504)
    at yT.invoke (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:14460)
    at lc.fire (/Users/jeremykahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:24:15230) {
  code: -32097,
  data: undefined
}
2023-04-25T17:58:02.673 INFO (pid:81749) [attach] - receive notification: showInfo []

Description

Loading any .kt file yields this error:

[coc.nvim] Kotlin Language Client client: couldn't create connection to server.

Extension version

0.0.9

Additional context

This happens on both MacOS and Linux. This was working before (in the same projects) a few weeks ago, so something seems to have changed.

weirongxu commented 1 year ago

I just tried some Kotlin projects on Linux and couldn't reproduce your problem. I tested both Java 11 and 15.

kotlin-language-server was updated two weeks ago, maybe it caused some bugs, but I use the latest 1.3.3 and it works.

Does this problem only appear in some specific projects or Java versions?

jeremyckahn commented 1 year ago

Thanks for following up, @weirongxu! I first experienced this issue in my day job projects, where coc-kotlin worked as of a few weeks ago. I also tried it on https://github.com/halilozel1903/KotlinTutorials and got the same results. Here is my CocInfo for that project, under Linux:

## versions

vim version: NVIM v0.8.3
node version: v19.7.0
coc.nvim version: 0.0.82-79e9e04 2023-02-15 20:36:03 -0800
coc.nvim directory: /home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim
term: xterm-256color
platform: linux

## Log of coc.nvim

2023-04-27T07:04:13.162 WARN (pid:997607) [workspace] - workspace.createOutputChannel is deprecated, please use window.createOutputChannel instead. 
    at Object.<anonymous> (/home/jeremyckahn/.config/coc/extensions/node_modules/coc-tailwindcss/out/index.js:14:7870)
    at Generator.next (<anonymous>)
2023-04-27T07:04:13.254 INFO (pid:997607) [extension:coc-git] - Looking for git in: git
2023-04-27T07:04:13.264 INFO (pid:997607) [plugin] - coc.nvim initialized with node: v19.7.0 after 402
2023-04-27T07:04:14.604 INFO (pid:997607) [attach] - receive notification: doAutocmd [ 2, 1 ]
2023-04-27T07:04:14.721 INFO (pid:997607) [language-client-index] - Language server "kotlin" started with 997672
2023-04-27T07:04:14.730 ERROR (pid:997607) [language-client] - Sending request failed.
2023-04-27T07:04:14.732 ERROR (pid:997607) [language-client-client] - Server kotlin initialization failed. ResponseError2: Pending response rejected since connection got disposed
    at Object.dispose (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:15673:25)
    at Object.dispose (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:66855:31)
    at LanguageClient.handleConnectionClosed (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:67788:30)
    at LanguageClient.handleConnectionClosed (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:68298:15)
    at closeHandler (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:67775:16)
    at CallbackList.invoke (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14102:35)
    at Emitter2.fire (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14153:34)
    at closeHandler (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14895:24)
    at CallbackList.invoke (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14102:35)
    at Emitter2.fire (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14153:34) {
  code: -32097,
  data: undefined
}
2023-04-27T07:04:14.755 INFO (pid:997607) [language-client-index] - Language server "kotlin" started with 997680
2023-04-27T07:04:14.759 INFO (pid:997607) [core-watchman] - watchman watching project: /home/jeremyckahn/oss/KotlinTutorials
2023-04-27T07:04:14.761 ERROR (pid:997607) [language-client-client] - Server kotlin initialization failed. ResponseError2: Pending response rejected since connection got disposed
    at Object.dispose (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:15673:25)
    at Object.dispose (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:66855:31)
    at LanguageClient.handleConnectionClosed (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:67788:30)
    at LanguageClient.handleConnectionClosed (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:68298:15)
    at closeHandler (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:67775:16)
    at CallbackList.invoke (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14102:35)
    at Emitter2.fire (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14153:34)
    at closeHandler (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14895:24)
    at CallbackList.invoke (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14102:35)
    at Emitter2.fire (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14153:34) {
  code: -32097,
  data: undefined
}
2023-04-27T07:04:14.761 ERROR (pid:997607) [server] - unhandledRejection  Promise {
  <rejected> ResponseError2: Pending response rejected since connection got disposed
      at Object.dispose (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:15673:25)
      at Object.dispose (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:66855:31)
      at LanguageClient.handleConnectionClosed (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:67788:30)
      at LanguageClient.handleConnectionClosed (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:68298:15)
      at closeHandler (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:67775:16)
      at CallbackList.invoke (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14102:35)
      at Emitter2.fire (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14153:34)
      at closeHandler (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14895:24)
      at CallbackList.invoke (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14102:35)
      at Emitter2.fire (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14153:34) {
    code: -32097,
    data: undefined
  },
  dispose: [Function (anonymous)]
} ResponseError2: Pending response rejected since connection got disposed
    at Object.dispose (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:15673:25)
    at Object.dispose (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:66855:31)
    at LanguageClient.handleConnectionClosed (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:67788:30)
    at LanguageClient.handleConnectionClosed (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:68298:15)
    at closeHandler (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:67775:16)
    at CallbackList.invoke (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14102:35)
    at Emitter2.fire (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14153:34)
    at closeHandler (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14895:24)
    at CallbackList.invoke (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14102:35)
    at Emitter2.fire (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14153:34) {
  code: -32097,
  data: undefined
}
2023-04-27T07:04:14.773 INFO (pid:997607) [language-client-index] - Language server "kotlin" started with 997685
2023-04-27T07:04:14.774 INFO (pid:997607) [attach] - receive notification: doAutocmd [ 6 ]
2023-04-27T07:04:14.781 ERROR (pid:997607) [language-client-client] - Server kotlin initialization failed. ResponseError2: Pending response rejected since connection got disposed
    at Object.dispose (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:15673:25)
    at Object.dispose (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:66855:31)
    at LanguageClient.handleConnectionClosed (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:67788:30)
    at LanguageClient.handleConnectionClosed (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:68298:15)
    at closeHandler (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:67775:16)
    at CallbackList.invoke (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14102:35)
    at Emitter2.fire (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14153:34)
    at closeHandler (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14895:24)
    at CallbackList.invoke (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14102:35)
    at Emitter2.fire (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14153:34) {
  code: -32097,
  data: undefined
}
2023-04-27T07:04:14.785 INFO (pid:997607) [language-client-index] - Language server "kotlin" started with 997690
2023-04-27T07:04:14.790 ERROR (pid:997607) [language-client-client] - Server kotlin initialization failed. ResponseError2: Pending response rejected since connection got disposed
    at Object.dispose (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:15673:25)
    at Object.dispose (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:66855:31)
    at LanguageClient.handleConnectionClosed (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:67788:30)
    at LanguageClient.handleConnectionClosed (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:68298:15)
    at closeHandler (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:67775:16)
    at CallbackList.invoke (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14102:35)
    at Emitter2.fire (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14153:34)
    at closeHandler (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14895:24)
    at CallbackList.invoke (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14102:35)
    at Emitter2.fire (/home/jeremyckahn/dotfiles/vim/.vim/plugged/coc.nvim/build/index.js:14153:34) {
  code: -32097,
  data: undefined
}
2023-04-27T07:04:19.039 INFO (pid:997607) [attach] - receive notification: showInfo []

The versions are a different here (I'm on a different machine), but coc-kotlin crashes similarly.

Do I need to have Java installed separately for coc-kotlin to work? I rarely work with Java/Kotlin but sometimes I need to explore Kotlin codebases for my job (which coc-kotlin is tremendously helpful for). So, I may be overlooking something basic or fundamental for getting this to work.

weirongxu commented 1 year ago

Hi @jeremyckahn.

I just tested it on https://github.com/halilozel1903/KotlinTutorials but it still works fine.

Can you use :CocCommand workspace.showOutput and check if coc-kotlin and kotlin-language-server have useful output?

Also, you can try deleting ~/.config/coc/extensions/coc-kotlin-data to let coc attempt to re-download the kotlin-language-server to resolve any possible network issues.

jeremyckahn commented 1 year ago

Also, you can try deleting ~/.config/coc/extensions/coc-kotlin-data to let coc attempt to re-download the kotlin-language-server to resolve any possible network issues.

This fixed the issue!! Thank you so much @weirongxu. It might be worth mentioning this in the README as a troubleshooting solution so you don't have to deal with issues like this in the future. 🙂

Just for posterity, I ran :CocCommand workspace.showOutput before deleting ~/.config/coc/extensions/coc-kotlin-data, and here's what it showed:

Output ``` Exception in thread "main" java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.cli.jvm.config.JvmContentRootsKt.configureJdkClasspathRoots(org.jetbrains.kotlin.config.CompilerConfiguration)' at org.javacs.kt.compiler.CompilationEnvironment.(Compiler.kt:120) at org.javacs.kt.compiler.Compiler.(Compiler.kt:452) at org.javacs.kt.CompilerClassPath.(CompilerClassPath.kt:26) at org.javacs.kt.KotlinLanguageServer.(KotlinLanguageServer.kt:25) at org.javacs.kt.MainKt.main(Main.kt:42) [Error - 21:39:40.438] /Users/jeremykahn/.config/coc/extensions/coc-kotlin-data/langServerInstall/server/bin/kotlin-language-server exited with code: 1 [Info - 21:39:40.438] Connection to server got closed. Server will restart. [Error - 21:39:40.439] Server initialization failed. Message: Pending response rejected since connection got disposed Code: -32097 [Error - 21:39:40.440] Kotlin Language Client client: couldn't create connection to server. Message: Pending response rejected since connection got disposed Code: -32097 Exception in thread "main" java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.cli.jvm.config.JvmContentRootsKt.configureJdkClasspathRoots(org.jetbrains.kotlin.config.CompilerConfiguration)' at org.javacs.kt.compiler.CompilationEnvironment.(Compiler.kt:120) at org.javacs.kt.compiler.Compiler.(Compiler.kt:452) at org.javacs.kt.CompilerClassPath.(CompilerClassPath.kt:26) at org.javacs.kt.KotlinLanguageServer.(KotlinLanguageServer.kt:25) at org.javacs.kt.MainKt.main(Main.kt:42) [Info - 21:39:40.722] Connection to server got closed. Server will restart. [Error - 21:39:40.722] Server initialization failed. Message: Pending response rejected since connection got disposed Code: -32097 [Error - 21:39:40.722] Kotlin Language Client client: couldn't create connection to server. Message: Pending response rejected since connection got disposed Code: -32097 [Error - 21:39:40.727] /Users/jeremykahn/.config/coc/extensions/coc-kotlin-data/langServerInstall/server/bin/kotlin-language-server exited with code: 1 Exception in thread "main" java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.cli.jvm.config.JvmContentRootsKt.configureJdkClasspathRoots(org.jetbrains.kotlin.config.CompilerConfiguration)' at org.javacs.kt.compiler.CompilationEnvironment.(Compiler.kt:120) at org.javacs.kt.compiler.Compiler.(Compiler.kt:452) at org.javacs.kt.CompilerClassPath.(CompilerClassPath.kt:26) at org.javacs.kt.KotlinLanguageServer.(KotlinLanguageServer.kt:25) at org.javacs.kt.MainKt.main(Main.kt:42) [Info - 21:39:41.003] Connection to server got closed. Server will restart. [Error - 21:39:41.004] Server initialization failed. Message: Pending response rejected since connection got disposed Code: -32097 [Error - 21:39:41.004] Kotlin Language Client client: couldn't create connection to server. Message: Pending response rejected since connection got disposed Code: -32097 [Error - 21:39:41.004] Restarting server failed Message: Pending response rejected since connection got disposed Code: -32097 [Error - 21:39:41.008] /Users/jeremykahn/.config/coc/extensions/coc-kotlin-data/langServerInstall/server/bin/kotlin-language-server exited with code: 1 Exception in thread "main" java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.cli.jvm.config.JvmContentRootsKt.configureJdkClasspathRoots(org.jetbrains.kotlin.config.CompilerConfiguration)' at org.javacs.kt.compiler.CompilationEnvironment.(Compiler.kt:120) at org.javacs.kt.compiler.Compiler.(Compiler.kt:452) at org.javacs.kt.CompilerClassPath.(CompilerClassPath.kt:26) at org.javacs.kt.KotlinLanguageServer.(KotlinLanguageServer.kt:25) at org.javacs.kt.MainKt.main(Main.kt:42) [Error - 21:39:41.284] Connection to server got closed. Server will not be restarted. [Error - 21:39:41.285] Server initialization failed. Message: Pending response rejected since connection got disposed Code: -32097 [Error - 21:39:41.285] Kotlin Language Client client: couldn't create connection to server. Message: Pending response rejected since connection got disposed Code: -32097 [Error - 21:39:41.285] Restarting server failed Message: Pending response rejected since connection got disposed Code: -32097 [Error - 21:39:41.285] /Users/jeremykahn/.config/coc/extensions/coc-kotlin-data/langServerInstall/server/bin/kotlin-language-server exited with code: 1 ```