Skip to content

Ignore workspace/didChangeConfiguration #114

Closed
@joewreschnig

Description

@joewreschnig

Describe the request

The eglot LSP client for Emacs sends the workspace/didChangeConfiguration notification by default on startup (and if configuration changes later).

arduino-language-server currently panics and dies if it receives this notification. However, since it's just a notification and doesn't demand the language server actually do anything, it seems like while unsupported it would be more useful as a no-op rather than a panic.

Describe the current behavior

The server panics when eglot connects and sends workspace/didChangeConfiguration.

[stderr] 2022/06/18 17:28:20 IDE --> LS NOTIF workspace/didChangeConfiguration
[stderr] 2022/06/18 17:28:20 Panic: unimplemented
[stderr] 
[stderr] goroutine 8 [running]:
[stderr] runtime/debug.Stack()
[stderr] 	/home/piman/sdk/go1.18/src/runtime/debug/stack.go:24 +0x65
[stderr] github.com/arduino/arduino-language-server/streams.CatchAndLogPanic()
[stderr] 	/home/piman/go/pkg/mod/github.com/arduino/arduino-language-server@v0.0.0-20220105094946-835a2f524a60/streams/panics.go:14 +0x74
[stderr] panic({0x9f4fa0, 0xbeba90})
[stderr] 	/home/piman/sdk/go1.18/src/runtime/panic.go:838 +0x207
[stderr] github.com/arduino/arduino-language-server/ls.(*IDELSPServer).WorkspaceDidChangeConfiguration(0xc0002cc1c8?, {0x11?, 0x18?}, 0x9d4880?)
[stderr] 	/home/piman/go/pkg/mod/github.com/arduino/arduino-language-server@v0.0.0-20220105094946-835a2f524a60/ls/lsp_server_ide.go:232 +0x27
etc

Arduino Language Server version

0.6.0

Arduino CLI version

0.23.0

Operating system

Linux

Operating system version

Debian 11.3

Additional context

For anyone finding this and trying to work around the issue, setting eglot-connect-hook to nil will disable the call on startup, but it may still be fired later. eglot-connect-hook is also flagged as a risky local variable which may require changing your enable-local-variables setting to load properly.

Issue checklist

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions