GNU bug report logs -
#59445
29.0.50; Tweak tree sitter faces in Java and TypeScript
Previous Next
Reported by: Theodor Thornhill <theo <at> thornhill.no>
Date: Mon, 21 Nov 2022 12:14:02 UTC
Severity: normal
Found in version 29.0.50
Fixed in version 29.1
Done: Yuan Fu <casouri <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Tuesday, November 22nd, 2022 at 05:08, Yuan Fu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> wrote:
>
> Randy Taylor dev <at> rjt.dev writes:
>
> > On Monday, November 21st, 2022 at 07:13, Theodor Thornhill via "Bug
> > reports for GNU Emacs, the Swiss army knife of text editors"
> > bug-gnu-emacs <at> gnu.org wrote:
> >
> > > Hi Yuan!
> > >
> > > I tweaked Java and TypeScript a little.
> > >
> > > Feel free to apply when you have the time :)
> > >
> > > Theo
>
>
> Thanks, I just applied this patch.
>
> > Looks good.
> >
> > For java-ts-mode.el can you show examples of what bracket and
> > delimiter highlight with your changes? I couldn't get them to
> > highlight anything when I tested and I had the exact same queries as
> > you, hence why I left them out of my patch. Similar thing occurred
> > with sh-script.el.
>
>
> Have you tried using treesit-query-capture to "manually" capture these
> nodes? I always use
>
> (treesit-query-capture (treesit-buffer-root-node) <query> (region-beginning) (region-end))
>
>
> Yuan
>
No, I've never tried that before. But I found out what the problem was:
'(["(" ")" "[" "]" "{" "}"] @font-lock-bracket-face)
The above query works fine for javascript and typescript, but not for java. Java needs it to be (note the parens surrounding the brackets):
'((["(" ")" "[" "]" "{" "}"]) @font-lock-bracket-face)
This bug report was last modified 2 years and 241 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.