Subject: bug#69683: 28.2; eglot overrides imenu without fallback even when unsupported by server

From: João Távora <[email-masked]>
Date: Sun, 10 Mar 2024 11:02:49 +0000

On Sun, Mar 10, 2024 at 5:53 AM Eli Zaretskii <[email-masked]> wrote:
>
> > From: Phil Hagelberg <[email-masked]>
> > 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?

You should both see bug#64274 before doing that.  Possibly
just a server bug.

João