unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Felician Nemeth <felician.nemeth@gmail.com>
Cc: 69657@debbugs.gnu.org, Sebastian Poeplau <sebastian.poeplau@mailbox.org>
Subject: bug#69657: Missing imenu entries with eglot
Date: Sun, 10 Mar 2024 01:05:34 +0000	[thread overview]
Message-ID: <CALDnm53uLT7Hq_1NEyyXiBQTgrf=F81Jp9Ebd=xvhNOqUCkAqA@mail.gmail.com> (raw)
In-Reply-To: <87v85v1io3.fsf@betli.tmit.bme.hu>

On Sat, Mar 9, 2024 at 4:20 PM Felician Nemeth
<felician.nemeth@gmail.com> wrote:
>
> CC-ing João, the maintainer of breadcrumb-mode.

I've made a file with

class Foo {
  void bar() {}
};

And the imenu--index-alist calculated by Eglot has what I think is the most
sensible way to represent this within the ancient rigid limitations of that
variable's format.

((#("Foo" 0 3 (breadcrumb-region (1 . 31) breadcrumb-kind "Class"))
  (#("bar" 0 3 (breadcrumb-region (15 . 28) breadcrumb-kind "Method"))
   . 15)))

I understand Sebastian wants to see an extra top-evel ("Foo" . 1) there
or something, but that leads to two entries with duplicate names and imenu
just doesn't like that (if I apply the patch I just can't go to 'bar' with M
-x imenu), neither do some of its clients.

This is way Eglot emits "breadcrumb"-friendly cookies to overcome imenu's
limitations.   Using breadcrumb i can jump to Foo and Foo > bar just
fine (using
`M-x breadcrumb-jump`).

These cookies are innocuous to anyone else.  But I guess if someone took the
time to consecrate them as imenu things instead of breadcrumb things. Then
others UIs could use them. Or someone could invent something much better
than imenu and have Eglot write to that idk.  Imenu is pretty cursed, but it's
what was already there so I picked it.

Anyway, if users don't like Eglot's imenu function, they can use something
else.  Eglot's imenu is different from c++-ts-mode, and afaik c++-ts-mode's is
already different from c++-mode's.  I wouldn't install this patch though,
teach other UIs about those optional cookies seems like a better deal that
doesn't break stuff.





  reply	other threads:[~2024-03-10  1:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 20:01 bug#69657: Missing imenu entries with eglot Sebastian Poeplau via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-08 21:44 ` Felician Nemeth
2024-03-08 22:28   ` Sebastian Poeplau via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-09 16:20     ` Felician Nemeth
2024-03-10  1:05       ` João Távora [this message]
2024-03-10 16:15         ` Sebastian Poeplau via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-10 19:15           ` Sebastian Poeplau via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-10 19:33             ` João Távora
2024-03-17 11:04               ` Sebastian Poeplau via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CALDnm53uLT7Hq_1NEyyXiBQTgrf=F81Jp9Ebd=xvhNOqUCkAqA@mail.gmail.com' \
    --to=joaotavora@gmail.com \
    --cc=69657@debbugs.gnu.org \
    --cc=felician.nemeth@gmail.com \
    --cc=sebastian.poeplau@mailbox.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).