all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Phil Hagelberg" <phil@hagelb.org>, "João Távora" <joaotavora@gmail.com>
Cc: 69683@debbugs.gnu.org
Subject: bug#69683: 28.2; eglot overrides imenu without fallback even when unsupported by server
Date: Sun, 10 Mar 2024 07:53:43 +0200	[thread overview]
Message-ID: <86sf0yws2g.fsf@gnu.org> (raw)
In-Reply-To: <87edcjt2ma.fsf@hagelb.org> (message from Phil Hagelberg on Sat,  09 Mar 2024 23:19:25 +0000)

> From: Phil Hagelberg <phil@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.





  reply	other threads:[~2024-03-10  5:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-09 23:19 bug#69683: 28.2; eglot overrides imenu without fallback even when unsupported by server Phil Hagelberg
2024-03-10  5:53 ` Eli Zaretskii [this message]
2024-03-10 11:02   ` João Távora
2024-03-10  9:46 ` Felician Nemeth
2024-03-10 19:27   ` Phil Hagelberg
2024-03-11  8:43     ` Felician Nemeth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86sf0yws2g.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=69683@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=phil@hagelb.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.