Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic: unimplemented request: workspace/semanticTokens/refresh #125

Open
3 tasks done
kittaakos opened this issue Jul 21, 2022 · 1 comment
Open
3 tasks done

Panic: unimplemented request: workspace/semanticTokens/refresh #125

kittaakos opened this issue Jul 21, 2022 · 1 comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@kittaakos
Copy link
Contributor

Describe the problem

I am playing with the LS to support multiple running language servers per workspace.

I see the following error:

Panic: unimplemented request: workspace/semanticTokens/refresh

goroutine 22 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x65
github.com/arduino/arduino-language-server/streams.CatchAndLogPanic()
	/home/build/streams/panics.go:14 +0x74
panic({0x4634b40, 0xc00030b770})
	/usr/local/go/src/runtime/panic.go:838 +0x207
go.bug.st/lsp.(*Client).requestDispatcher(0xc000432090, {0x4849750, 0xc00028cac0}, {0x4844020, 0xc00000eaf8}, {0xc000042f80, 0x20}, {0xc00028f088, 0x4, 0x8}, ...)
	/go/pkg/mod/go.bug.st/[email protected]/client.go:199 +0x9fd
go.bug.st/lsp/jsonrpc.(*Connection).handleIncomingRequest(0xc000174000, 0xc000254dc0)
	/go/pkg/mod/go.bug.st/[email protected]/jsonrpc/jsonrpc_connection.go:153 +0x2bb
go.bug.st/lsp/jsonrpc.(*Connection).handleIncomingData(0xc000174000, {0xc000041740, 0x52, 0x52})
	/go/pkg/mod/go.bug.st/[email protected]/jsonrpc/jsonrpc_connection.go:128 +0x167
go.bug.st/lsp/jsonrpc.(*Connection).Run(0xc000174000)
	/go/pkg/mod/go.bug.st/[email protected]/jsonrpc/jsonrpc_connection.go:119 +0x98
go.bug.st/lsp.(*Client).Run(...)
	/go/pkg/mod/go.bug.st/[email protected]/client.go:83
github.com/arduino/arduino-language-server/ls.(*ClangdLSPClient).Run(...)
	/home/build/ls/lsp_client_clangd.go:86
github.com/arduino/arduino-language-server/ls.(*INOLanguageServer).InitializeReqFromIDE.func1.1()
	/home/build/ls/ls.go:201 +0x5b
created by github.com/arduino/arduino-language-server/ls.(*INOLanguageServer).InitializeReqFromIDE.func1
	/home/build/ls/ls.go:199 +0x4b0

panic: unimplemented request: workspace/semanticTokens/refresh [recovered]
	panic: unimplemented request: workspace/semanticTokens/refresh

goroutine 22 [running]:
github.com/arduino/arduino-language-server/streams.CatchAndLogPanic()
	/home/build/streams/panics.go:15 +0x145
panic({0x4634b40, 0xc00030b770})
	/usr/local/go/src/runtime/panic.go:838 +0x207
go.bug.st/lsp.(*Client).requestDispatcher(0xc000432090, {0x4849750, 0xc00028cac0}, {0x4844020, 0xc00000eaf8}, {0xc000042f80, 0x20}, {0xc00028f088, 0x4, 0x8}, ...)
	/go/pkg/mod/go.bug.st/[email protected]/client.go:199 +0x9fd
go.bug.st/lsp/jsonrpc.(*Connection).handleIncomingRequest(0xc000174000, 0xc000254dc0)
	/go/pkg/mod/go.bug.st/[email protected]/jsonrpc/jsonrpc_connection.go:153 +0x2bb
go.bug.st/lsp/jsonrpc.(*Connection).handleIncomingData(0xc000174000, {0xc000041740, 0x52, 0x52})
	/go/pkg/mod/go.bug.st/[email protected]/jsonrpc/jsonrpc_connection.go:128 +0x167
go.bug.st/lsp/jsonrpc.(*Connection).Run(0xc000174000)
	/go/pkg/mod/go.bug.st/[email protected]/jsonrpc/jsonrpc_connection.go:119 +0x98
go.bug.st/lsp.(*Client).Run(...)
	/go/pkg/mod/go.bug.st/[email protected]/client.go:83
github.com/arduino/arduino-language-server/ls.(*ClangdLSPClient).Run(...)
	/home/build/ls/lsp_client_clangd.go:86
github.com/arduino/arduino-language-server/ls.(*INOLanguageServer).InitializeReqFromIDE.func1.1()
	/home/build/ls/ls.go:201 +0x5b
created by github.com/arduino/arduino-language-server/ls.(*INOLanguageServer).InitializeReqFromIDE.func1
	/home/build/ls/ls.go:199 +0x4b0

To reproduce

Install the VS Code extension from my fork: https://github.com/kittaakos/vscode-arduino-tools/tree/multi-ls-support/build-artifacts

  • Start VS Code,
  • Open the sketchbook (assuming it contains more than one sketches) sketch

Expected behavior

It does not throw.

Arduino Language Server version

0.7.1

Arduino CLI version

0.25.0

Operating system

macOS

Operating system version

12.3.1

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details
@GiorgosXou
Copy link

In my case, the solution for Astronvim was:

          config.capabilities.textDocument.semanticTokens = vim.NIL
          config.capabilities.workspace.semanticTokens = vim.NIL
      arduino_language_server = { --  https://github.com/williamboman/nvim-lsp-installer/tree/main/lua/nvim-lsp-installer/servers/arduino_language_server | https://discord.com/channels/939594913560031363/1078005571451621546/threads/1122910773270818887
        on_new_config = function (config, root_dir)
          local my_arduino_fqbn = { -- arduino-cli core install arduino:... 
            ["/home/xou/Desktop/xou/programming/hardware/arduino/nano"]  = "arduino:avr:nano", -- arduino-cli board listall
            ["/home/xou/Desktop/xou/programming/hardware/arduino/uno" ]  = "arduino:avr:uno" ,
          }
          local DEFAULT_FQBN = "arduino:avr:uno"
          local fqbn = my_arduino_fqbn[root_dir]
          if not fqbn then
            -- vim.notify(("Could not find which FQBN to use in %q. Defaulting to %q."):format(root_dir, DEFAULT_FQBN))
            fqbn = DEFAULT_FQBN
          end
          config.capabilities.textDocument.semanticTokens = vim.NIL
          config.capabilities.workspace.semanticTokens = vim.NIL
          config.cmd = {         --  https://forum.arduino.cc/t/solved-errors-with-clangd-startup-for-arduino-language-server-in-nvim/1019977
            "arduino-language-server",
            "-cli-config" , "~/arduino15/arduino-cli.yaml", -- just in case it was /home/xou/.arduino15/arduino-cli.yaml 
            "-cli"        , "/usr/bin/arduino-cli", -- 2023-06-26 ERROR | "Runs" if I set a wrong path
            "-clangd"     , "/usr/bin/clangd",
            "-fqbn"       , fqbn
          }
        end
      },

@kittaakos kittaakos removed their assignment Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants