From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69683: 28.2; eglot overrides imenu without fallback even when unsupported by server Date: Sun, 10 Mar 2024 07:53:43 +0200 Message-ID: <86sf0yws2g.fsf@gnu.org> References: <87edcjt2ma.fsf@hagelb.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10892"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69683@debbugs.gnu.org To: Phil Hagelberg , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 10 06:56:52 2024 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 1rjCB1-0002fZ-Qc for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Mar 2024 06:56:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjCAo-0007NB-Jp; Sun, 10 Mar 2024 00:56:38 -0500 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 1rjCAf-0007MV-Hg for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 00:56:30 -0500 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 1rjCAf-0000uG-9d for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 00:56:29 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rjCBC-0004FR-4Y for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 00:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 05:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69683 X-GNU-PR-Package: emacs Original-Received: via spool by 69683-submit@debbugs.gnu.org id=B69683.171005020316301 (code B ref 69683); Sun, 10 Mar 2024 05:57:02 +0000 Original-Received: (at 69683) by debbugs.gnu.org; 10 Mar 2024 05:56:43 +0000 Original-Received: from localhost ([127.0.0.1]:35251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjCAt-0004Er-89 for submit@debbugs.gnu.org; Sun, 10 Mar 2024 00:56:43 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjCAo-0004EV-At for 69683@debbugs.gnu.org; Sun, 10 Mar 2024 00:56:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjC84-0000Aw-Sw; Sun, 10 Mar 2024 00:53:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=rFk64OxUjPld5tjAahQKC6UveC9q0soByD+7827pNjk=; b=Im3dtB/PNtCjZzLtB2zg babFRmNN5ILo/B3oMm/MJW284TeP0gDOQSa5xW62zoyusl+AgAcw2p0jzantycy96u0g5Fiw4yzRS bN3koHPayKOUz9Wxo6qa1LXYKdjEHGuukuthd/KNZPbOM5q0BHCGGZllNxDrs3RiBEZG+hYd+eqgD XU8cQxdWI8le3Ur8Dv+tOpw4f2gFS516UEmxD4cC+PmZyLuI4lWj2xFbLZ3dOiEGJRsSjo3okAj5E S5mA8clD/fYIszB0y7LaHKmxiwbAFHQ/6fPeJ1QR4dNDZilKiXjMbpn1pOVUBS9pd8Z1k33uItGIj yansG+ujvToLuA==; In-Reply-To: <87edcjt2ma.fsf@hagelb.org> (message from Phil Hagelberg on Sat, 09 Mar 2024 23:19:25 +0000) 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:281370 Archived-At: > From: Phil Hagelberg > 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.