From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Brian Leung Newsgroups: gmane.emacs.bugs Subject: bug#64682: [PATCH] eglot.el: Avoid premature bailout in eglot-imenu Date: Mon, 17 Jul 2023 12:09:26 +0000 Message-ID: <87mszuybrc.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39850"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: 64682@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 17 14:17:22 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qLNAI-000A9O-G6 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Jul 2023 14:17:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNA1-0005C5-Bn; Mon, 17 Jul 2023 08:17:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qLN9y-0005Bt-QO for bug-gnu-emacs@gnu.org; Mon, 17 Jul 2023 08:17:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qLN9y-00016W-Eg for bug-gnu-emacs@gnu.org; Mon, 17 Jul 2023 08:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qLN9y-0000v4-AH for bug-gnu-emacs@gnu.org; Mon, 17 Jul 2023 08:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Brian Leung Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Jul 2023 12:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64682 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16895961753367 (code B ref -1); Mon, 17 Jul 2023 12:17:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Jul 2023 12:16:15 +0000 Original-Received: from localhost ([127.0.0.1]:49259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLN9C-0000sF-TM for submit@debbugs.gnu.org; Mon, 17 Jul 2023 08:16:15 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:50634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLN9A-0000rY-1o for submit@debbugs.gnu.org; Mon, 17 Jul 2023 08:16:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qLN92-00055M-NO for bug-gnu-emacs@gnu.org; Mon, 17 Jul 2023 08:16:06 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qLN8y-0000tw-0L for bug-gnu-emacs@gnu.org; Mon, 17 Jul 2023 08:16:04 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 5163E240101 for ; Mon, 17 Jul 2023 14:15:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1689596155; bh=HmmSezm9ajW6XBrZrBWZTyJR/YX0Y6c1B0VuFO38GdI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=bVy4GoM9mByPiZGVIM9T4SiIRQ0msbdoLFkrFRmUigJDZ2bkTid7bpi91GAJgqQ+/ 0CHyakL6/26zxvK+M6fpCmRsGWRhyggGADTxgenFeJJEhNYswgNn6bEs+XpZ0ax7QC x+y508zR9ELUT7QxDjs8XI+afk4nvyvSOIoN8hGR98ciFjix7kwB96fcLu5LWfPZeh 0qtHyPIYG9e/fVbsaXH2zeGEmrCHT6UL/yGXdKf8xQ5FFwWj8Qm++UPqkp8dTuMSHF SrBbZ+pSDWypsVyPeoZiWg6AQQAMVuVOECuVuqf6o9bNiie4iJUzQ6bGipMF9ZlpF6 QgZK7QihDOrZw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4R4Ldk0NQ6z9rxK; Mon, 17 Jul 2023 14:15:53 +0200 (CEST) Received-SPF: pass client-ip=185.67.36.66; envelope-from=leungbk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:265387 Archived-At: --=-=-= Content-Type: text/plain; format=flowed 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' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-eglot.el-Avoid-premature-bailout-in-eglot-imenu.patch >From d340d56e006d7cbb047d966fa117994c6d93e13f Mon Sep 17 00:00:00 2001 From: Brian Leung 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 --=-=-=--