From: Brian Leung <leungbk@posteo.net>
To: 64682@debbugs.gnu.org
Cc: "João Távora" <joaotavora@gmail.com>
Subject: bug#64682: [PATCH] eglot.el: Avoid premature bailout in eglot-imenu
Date: Mon, 17 Jul 2023 12:09:26 +0000 [thread overview]
Message-ID: <87mszuybrc.fsf@posteo.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 915 bytes --]
Tags: patch
On current master branch, running M-: (eglot-imenu) in buffers
using LSP servers supporting the textDocument/documentSymbol
request always results in an early exit since the server
capability is NOT named "textDocument/documentSymbol", but rather
"documentSymbolProvider".
This patch corrects that, so that now (eglot-imenu) works as
expected.
In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit,
cairo
version 1.16.0, Xaw3d scroll bars)
Repository revision: c5fa58cbc4a33a0a65494b9ab2e35d4f30ab849b
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version
11.0.12101008
System Description: NixOS 23.11 (Tapir)
Configured using:
'configure
--prefix=/nix/store/rl8pgvclyashprbz6xr84x6l0n9q37l2-emacs-git-20230715.0
--disable-build-details --with-modules --with-x-toolkit=lucid
--with-xft --with-cairo --with-native-compilation
--with-tree-sitter'
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-eglot.el-Avoid-premature-bailout-in-eglot-imenu.patch --]
[-- Type: text/patch, Size: 1186 bytes --]
From d340d56e006d7cbb047d966fa117994c6d93e13f Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@posteo.net>
Date: Mon, 17 Jul 2023 05:04:28 -0700
Subject: [PATCH] eglot.el: Avoid premature bailout in eglot-imenu
* lisp/progmodes/eglot.el (eglot-imenu): Declare the correct name of
the server capability providing textDocument/documentSymbol.
Without this change, eglot-imenu always aborts even when used with
servers supporting textDocument/documentSymbol.
---
lisp/progmodes/eglot.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 8ac21638a5b..1df3a8844f8 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3367,7 +3367,7 @@ eglot--imenu-DocumentSymbol
(cl-defun eglot-imenu ()
"Eglot's `imenu-create-index-function'.
Returns a list as described in docstring of `imenu--index-alist'."
- (unless (eglot--server-capable :textDocument/documentSymbol)
+ (unless (eglot--server-capable :documentSymbolProvider)
(cl-return-from eglot-imenu))
(let* ((res (eglot--request (eglot--current-server-or-lose)
:textDocument/documentSymbol
--
2.41.0
next reply other threads:[~2023-07-17 12:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 12:09 Brian Leung [this message]
2023-07-17 13:38 ` bug#64682: [PATCH] eglot.el: Avoid premature bailout in eglot-imenu João Távora
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=87mszuybrc.fsf@posteo.net \
--to=leungbk@posteo.net \
--cc=64682@debbugs.gnu.org \
--cc=joaotavora@gmail.com \
/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.