From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sebastian Poeplau via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69657: Missing imenu entries with eglot Date: Sun, 10 Mar 2024 20:15:04 +0100 Message-ID: <87frwxuc1w.fsf@mailbox.org> References: <87frx0ze5n.fsf@mailbox.org> <87a5n8s8jw.fsf@betli.tmit.bme.hu> <87bk7oz6vc.fsf@mailbox.org> <87v85v1io3.fsf@betli.tmit.bme.hu> <87jzmat5qe.fsf@mailbox.org> Reply-To: Sebastian Poeplau Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25543"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69657@debbugs.gnu.org, Felician Nemeth To: =?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 Mon Mar 11 03:47:00 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 1rjVgp-0006Ny-DX for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Mar 2024 03:46:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjVgP-0000iN-Ag; Sun, 10 Mar 2024 22:46:33 -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 1rjVgL-0000fv-SZ for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 22:46:30 -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 1rjVgL-0000Pg-Jr for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 22:46:29 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rjVgt-0005NZ-53 for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 22:47:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sebastian Poeplau Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2024 02:47:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69657 X-GNU-PR-Package: emacs Original-Received: via spool by 69657-submit@debbugs.gnu.org id=B69657.171012518420590 (code B ref 69657); Mon, 11 Mar 2024 02:47:03 +0000 Original-Received: (at 69657) by debbugs.gnu.org; 11 Mar 2024 02:46:24 +0000 Original-Received: from localhost ([127.0.0.1]:38223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjVgB-0005Lq-EG for submit@debbugs.gnu.org; Sun, 10 Mar 2024 22:46:24 -0400 Original-Received: from mout-p-202.mailbox.org ([80.241.56.172]:39190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjOlS-0002Nv-G6 for 69657@debbugs.gnu.org; Sun, 10 Mar 2024 15:23:20 -0400 Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4Tt8tj1LWZz9sq4; Sun, 10 Mar 2024 20:22:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1710098557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Fd8MSf9A7rnlD/DPorGeXUN+aKKhyABVy0gdUgRGfV8=; b=UmDq5CIADAwBrsETWdducvM3uEklwbKOEz0uMvIgDz6i3N+27cb4v3nvN57EAP1qxLuj0m /YN55M8f9Islk2wa3m2K5EksdV37kafBnXvuGgdIB+Z8Dvemlqt8GZCyI4S8AgH5qXyR7t gEPb1mWZHGsX4WvylXUZBXblwxyMQ9yqT5cc4ZoXidGNiJ2yh9eAWPjBLQxc1GYRXE3z0m 7T6/4RidjYnX1Ews4BVmXXHfZFpcv2jmd7I46mUY3SV6kqVYqpSYiTJvk2EgBOPp7h23ZK n9CERK3ZWuo2k6KGeyNsNIufY2Rd/v9l8Imf2LzG0hJ/RdDDCUupDN8970UOPA== In-reply-to: <87jzmat5qe.fsf@mailbox.org> X-MBO-RS-META: p3txumroh7jcx7zwg866mf7a4xng81k1 X-MBO-RS-ID: 97c55910d12e2fa5fd4 X-Mailman-Approved-At: Sun, 10 Mar 2024 22:46:17 -0400 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:281449 Archived-At: > I wonder why I did get separate entries in consult-imenu with pylsp > though. I'll have to give it another look, but it seems to me that in > this case (e.g., with SymbolInformation objects) eglot's imenu function > returns data that (a) works with plain imenu and (b) gives me what I > expect with consult-imenu. Here's the return value of eglot-imenu with pylsp: ((#1="Class" (#("Foo" 0 3 (breadcrumb-kind #1# breadcrumb-region (1 . 44))) . 1)) (#2="Method" ("Foo" (#("bar" 0 3 (breadcrumb-kind #2# breadcrumb-region (16 . 44))) . 16)))) The Python code I used is the following: class Foo: def bar(self): pass Like I said before, in this case I would consider the behavior of plain imenu, consult-imenu, and which-function-mode as correct, even though they don't use the breadcrumb annotations. I can jump to both the class and the method, and outside the method which-function-mode tells me that I'm in Foo. Maybe we could make eglot produce something similar for the data from clangd... For completeness, this is pylsp's response to textDocument/documentSymbol: { "jsonrpc": "2.0", "id": 21, "result": [ { "name": "Foo", "containerName": null, "location": { "uri": "file:///tmp/test.py", "range": { "start": { "line": 0, "character": 0 }, "end": { "line": 3, "character": 0 } } }, "kind": 5 }, { "name": "bar", "containerName": "Foo", "location": { "uri": "file:///tmp/test.py", "range": { "start": { "line": 1, "character": 4 }, "end": { "line": 3, "character": 0 } } }, "kind": 6 } ] }