From: Benjamin Leis via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Yuan Fu <casouri@gmail.com>
Cc: Theodor Thornhill <theo@thornhill.no>,
"70614@debbugs.gnu.org" <70614@debbugs.gnu.org>
Subject: bug#70614: Wrong simple imenu definition for java
Date: Tue, 30 Apr 2024 16:34:32 +0000 [thread overview]
Message-ID: <SN6PR08MB532664FDF3DF211A746DB8858B1A2@SN6PR08MB5326.namprd08.prod.outlook.com> (raw)
In-Reply-To: <80AE11C5-BE51-461C-B53D-4FB64BA05876@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1889 bytes --]
Hi Yuan
Yes it was me that posted on reddit. I’ll look into the sparse tree method – that looks promising. I’d be happy to add into the tree. What would the process be for that?
Ben
From: Yuan Fu <casouri@gmail.com>
Date: Monday, April 29, 2024 at 10:06 PM
To: Benjamin Leis <benjamin.leis@servicenow.com>
Cc: 70614@debbugs.gnu.org <70614@debbugs.gnu.org>, Theodor Thornhill <theo@thornhill.no>
Subject: Re: bug#70614: Wrong simple imenu definition for java
[External Email]
> On Apr 27, 2024, at 11:45 AM, Benjamin Leis via Bug reports for GNU Emacs, the Swiss army knife of text editors <bug-gnu-emacs@gnu.org> wrote:
>
> I noticed the treesitter imenu definitions for java in java-ts-mode.el have the following:
> ;; Imenu.
> (setq-local treesit-simple-imenu-settings
> '(("Class" \\`class_declaration\\' nil nil)
> ("Interface" \\`interface_declaration\\' nil nil)
> ("Enum" \\`record_declaration\\' nil nil)
> ("Method" \\`method_declaration\\' nil nil)))
> (treesit-major-mode-setup))
> The 3rd definition for enums should either be for “Record” if that was the intention or match against \\`enum_declaration if it really was meant for enums.
> Ben
Thanks for reporting that! Is that you who posted this post on reddit?
https://www.reddit.com/r/emacs/comments/1cej9fr/hierarchical_treesitter_based_imenulist_with_java/<https://www.reddit.com/r/emacs/comments/1cej9fr/hierarchical_treesitter_based_imenulist_with_java>
It looks pretty nice, do you want to just put it in Emacs? Also, there’s a chance that your code can be simplified by using treesit-induce-sparse-tree. You can look at treesit-simple-imenu for now it’s used. Basically we use treesit-induce-sparse-tree to find all the interesting nodes in the buffer, and go through the returned tree to convert nodes into imenu labels.
Also CCing Theo; Theo, WDYT?
Yuan
[-- Attachment #2: Type: text/html, Size: 4148 bytes --]
next prev parent reply other threads:[~2024-04-30 16:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-27 18:45 bug#70614: Wrong simple imenu definition for java Benjamin Leis via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-30 5:06 ` Yuan Fu
2024-04-30 16:34 ` Benjamin Leis via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-04-30 18:30 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-30 20:55 ` Benjamin Leis via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-01 1:10 ` Yuan Fu
2024-05-01 12:00 ` Eli Zaretskii
2024-04-30 18:27 ` Theodor Thornhill 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SN6PR08MB532664FDF3DF211A746DB8858B1A2@SN6PR08MB5326.namprd08.prod.outlook.com \
--to=bug-gnu-emacs@gnu.org \
--cc=70614@debbugs.gnu.org \
--cc=benjamin.leis@servicenow.com \
--cc=casouri@gmail.com \
--cc=theo@thornhill.no \
/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.