arduino / arduino-language-server

An Arduino Language Server based on Clangd to Arduino code autocompletion
GNU Affero General Public License v3.0
117 stars 11 forks source link

LS wont work on neovim: "`Panic: unimplemented request: workspace/semanticTokens/refresh`" #155

Open Aggeloz opened 1 year ago

Aggeloz commented 1 year ago

Describe the problem

I installed NVChad and i tried installing the Arduino LS but every time i open a project it stops and i get this panic in the log:

[ERROR][2023-05-10 11:50:32] .../vim/lsp/rpc.lua:734    "rpc"   "arduino-language-server"   "stderr"    "11:50:32.145073 \27[91mIDE     LS <-- Clangd REQU workspace/semanticTokens/refresh 1\27[0m\n"
[ERROR][2023-05-10 11:50:32] .../vim/lsp/rpc.lua:734    "rpc"   "arduino-language-server"   "stderr"    "11:50:32.145150 Panic: unimplemented request: workspace/semanticTokens/refresh\n\ngoroutine 13 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x65\ngithub.com/arduino/arduino-language-server/streams.CatchAndLogPanic()\n\t/home/build/streams/panics.go:29 +0x74\npanic({0xa353e0, 0xc00001c690})\n\t/usr/local/go/src/runtime/panic.go:838 +0x207\ngo.bug.st/lsp.(*Client).requestDispatcher(0xc0003947b0, {0xc49e70, 0xc00020ee80}, {0xc447e0, 0xc0002f4498}, {0xc0005a2920, 0x20}, {0xc000038ad8, 0x4, 0x8}, ...)\n\t/go/pkg/mod/go.bug.st/lsp@v0.1.2/client.go:199 +0x9fd\ngo.bug.st/lsp/jsonrpc.(*Connection).handleIncomingRequest(0xc000106080, 0xc0001d90e0)\n\t/go/pkg/mod/go.bug.st/lsp@v0.1.2/jsonrpc/jsonrpc_connection.go:153 +0x2bb\ngo.bug.st/lsp/jsonrpc.(*Connection).handleIncomingData(0xc000106080, {0xc00001e540, 0x52, 0x52})\n\t/go/pkg/mod/go.bug.st/lsp@v0.1.2/jsonrpc/jsonrpc_connection.go:128 +0x167\ngo.bug.st/lsp/jsonrpc.(*Connection).Run(0xc000106080)\n\t/go/pkg/mod/go.bug.st/lsp@v0.1.2/jsonrpc/jsonrpc_connection.go:119 +0x98\ngo.bug.st/lsp.(*Client).Run(...)\n\t/go/pkg/mod/go.bug.st/lsp@v0.1.2/client.go:83\ngithub.com/arduino/arduino-language-server/ls.(*clangdLSPClient).Run(...)\n\t/home/build/ls/lsp_client_clangd.go:103\ngithub.com/arduino/arduino-language-server/ls.(*INOLanguageServer).initializeReqFromIDE.func1.1()\n\t/home/build/ls/ls.go:218 +0x5b\ncreated by github.com/arduino/arduino-language-server/ls.(*INOLanguageServer).initializeReqFromIDE.func1\n\t/home/build/ls/ls.go:216 +0x4b0\n\n"
[ERROR][2023-05-10 11:50:32] .../vim/lsp/rpc.lua:734    "rpc"   "arduino-language-server"   "stderr"    "panic: unimplemented request: workspace/semanticTokens/refresh [recovered]\n\tpanic: unimplemented request: workspace/semanticTokens/refresh\n\ngoroutine 13 [running]:\ngithub.com/arduino/arduino-language-server/streams.CatchAndLogPanic()\n\t/home/build/streams/panics.go:30 +0x145\npanic({0xa353e0, 0xc00001c690})\n\t/usr/local/go/src/runtime/panic.go:838"
[ERROR][2023-05-10 11:50:32] .../vim/lsp/rpc.lua:734    "rpc"   "arduino-language-server"   "stderr"    " +0x207\ngo.bug.st/lsp.(*Client).requestDispatcher(0xc0003947b0, {0xc49e70, 0xc00020ee80}, {0xc447e0, 0xc0002f4498}, {0xc0005a2920, 0x20}, {0xc000038ad8, 0x4, 0x8}, ...)\n\t/go/pkg/mod/go.bug.st/lsp@v0.1.2/client.go:199 +0x9fd\ngo.bug.st/lsp/jsonrpc.(*Connection).handleIncomingRequest(0xc000106080, 0xc0001d90e0)\n\t/go/pkg/mod/go.bug.st/lsp@v0.1.2/jsonrpc/jsonrpc_connection.go:153 +0x2bb\ngo.bug.st/lsp/jsonrpc.(*Connection).handleIncomingData(0xc000106080, {0xc00001e540, 0x52, 0x52})\n\t/go/pkg/mod/go.bug.st/lsp@v0.1.2/jsonrpc/jsonrpc_connection.go:128 +0x167\ngo.bug.st/lsp/jsonrpc.(*Connection).Run(0xc000106080)\n\t/go/pkg/mod/go.bug.st/lsp@v0.1.2/jsonrpc/jsonrpc_connection.go:119 +0x98\ngo.bug.st/lsp.(*Client).Run(...)\n\t/go/pkg/mod/go.bug.st/lsp@v0.1.2/client.go:83\ngithub.com/arduino/arduino-language-server/ls.(*clangdLSPClient).Run(...)\n\t/home/build/ls/lsp_client_clangd.go:103\ngithub.com/arduino/arduino-language-server/ls.(*INOLanguageServer).initializeReqFromIDE.func1.1()\n\t/home/build/ls/ls.go:218 +0x5b\ncreated by github.com/arduino/arduino-language-server/ls.(*INOLanguageServer).initializeReqFromIDE.func1\n\t/home/build/ls/ls.go:216 +0x4b0\n"

Full output log is here (it was too long to paste in the issue):

logs.log

Expected behavior

I should be able to get auto complete and the rest of the features but all i get is client 8 quit with exit code 2 and signal 0

Arduino Language Server version

0.7.4

Arduino CLI version

0.32.2

Operating system

Linux

Operating system version

Arch Linux

Additional context

No response

Issue checklist

BrunoCooper17 commented 1 year ago

I was having a similar issue. Just have to let default server capabilities configuration (no capabilities = capabilities as the default NvChad lspconfig suggest).

arduino-language-server does not support lsp semantic tokens and NvChad tries to set it.

GiorgosXou commented 1 year ago

I'm having the same issue in AstroNvim and I have no Idea how to disable those semantic tokens