bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#69683: 28.2; eglot overrides imenu without fallback even when unsupp


From: Felician Nemeth
Subject: bug#69683: 28.2; eglot overrides imenu without fallback even when unsupported by server
Date: Sun, 10 Mar 2024 10:46:04 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Phil Hagelberg <phil@hagelb.org> writes:

> 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)
>

I'm surprised to see this error message since eglot-imenu starts with
this:

(cl-defun eglot-imenu ()
  (unless (eglot-server-capable :documentSymbolProvider)
    (cl-return-from eglot-imenu))

That is if the LSP server does not have the necessary capability it
doesn't send any jsonrpc messages to the server that would lead to the
error above.  (And it falls back to normal imenu.)

Can you run edebug on eglot-imenu to see what I misunderstand?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]