arduino-language-server icon indicating copy to clipboard operation
arduino-language-server copied to clipboard

Add support for window/progress notification

Open ssipos90 opened this issue 2 years ago • 0 comments

Describe the request

Either implement or at least stop crashing when notifying for that.

Describe the current behavior

Neovim has this function that you can check if a server is ready, vim.lsp.buf.server_ready() which returns bool. If you call this function, arduino language server crashes, it can't handle that event (might be clangd who can't handle it). The function uses window/progress notification as seen in the source code:

function M.server_ready()
  return not not vim.lsp.buf_notify(0, 'window/progress', {})
end

The error logged by neovim's LSP is:

Panic: unimplemented notification: window/progress

goroutine 21 [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:29 +0x74
panic({0xa353e0, 0xc0000fd8d0})
	/usr/local/go/src/runtime/panic.go:838 +0x207
go.bug.st/lsp.(*Server).notificationDispatcher(0xc000240c00, {0xc447e0, 0xc0004045d0}, {0xc000421530, 0xf}, {0xc000421520, 0x2, 0x8})
	/go/pkg/mod/go.bug.st/[email protected]/server.go:252 +0xed4
go.bug.st/lsp/jsonrpc.(*Connection).handleIncomingNotification(0xc000190c00, 0xc00004ab80)
	/go/pkg/mod/go.bug.st/[email protected]/jsonrpc/jsonrpc_connection.go:192 +0x1e3
go.bug.st/lsp/jsonrpc.(*Connection).handleIncomingData(0xc000190c00, {0xc000162700, 0x39, 0x39})
	/go/pkg/mod/go.bug.st/[email protected]/jsonrpc/jsonrpc_connection.go:130 +0x156
go.bug.st/lsp/jsonrpc.(*Connection).Run(0xc000190c00)
	/go/pkg/mod/go.bug.st/[email protected]/jsonrpc/jsonrpc_connection.go:119 +0x98
go.bug.st/lsp.(*Server).Run(...)
	/go/pkg/mod/go.bug.st/[email protected]/server.go:134
github.com/arduino/arduino-language-server/ls.(*IDELSPServer).Run(...)
	/home/build/ls/lsp_server_ide.go:53
github.com/arduino/arduino-language-server/ls.NewINOLanguageServer.func1()
	/home/build/ls/ls.go:167 +0x5b
created by github.com/arduino/arduino-language-server/ls.NewINOLanguageServer
	/home/build/ls/ls.go:165 +0x6dc

Arduino Language Server version

0.7.4

Arduino CLI version

0.29.0-arch

Operating system

Linux

Operating system version

ManjaroLinux 22.0.1

Additional context

No response

Issue checklist

  • [X] I searched for previous requests in the issue tracker
  • [X] I verified the feature was still missing when using the latest version
  • [X] My request contains all necessary details

ssipos90 avatar Feb 11 '23 16:02 ssipos90