Closed jeremyckahn closed 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?
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.
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.
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:
Result from CocInfo
Description
Loading any
.kt
file yields this error: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.