GNU bug report logs -
#69683
28.2; eglot overrides imenu without fallback even when unsupported by server
Previous Next
Reported by: Phil Hagelberg <phil <at> hagelb.org>
Date: Sat, 9 Mar 2024 23:21:02 UTC
Severity: normal
Found in version 28.2
Done: Felician Nemeth <felician.nemeth <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 69683 <at> debbugs.gnu.org (full text, mbox):
> From: Phil Hagelberg <phil <at> hagelb.org>
> Date: Sat, 09 Mar 2024 23:19:25 +0000
>
> When invoking M-x imenu in a buffer with eglot enabled, it uses eglot's
> LSP-aware implementation of imenu. However, not all LSP servers handle
> that functionality. When connected to a server that does not offer this
> functionality, eglot signals an error:
>
> jsonrpc-error: "request id=11 failed:", (jsonrpc-error-code . -32601), (jsonrpc-error-message . "\"textDocument/documentSymbol\" is not in the request-handlers table"), (jsonrpc-error-data)
>
> However, usually there is a perfectly good functional imenu
> implementation that the user wants to invoke; they just can't do it
> because eglot took over the imenu command.
>
> Ideally eglot should only add its functionality to the imenu command
> when it's connected to a server that actually supports the endpoint
> needed to handle it.
Thanks. Would you like to suggest a patch along these lines?
An alternative would be to catch this error and fall back on the imenu
implementation. Not being an LSP expert, I'm unsure which approach is
better/cleaner.
This bug report was last modified 1 year and 68 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.