unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Randy Taylor <dev@rjt.dev>
To: Yuan Fu <yuf011@ucsd.edu>
Cc: 59445@debbugs.gnu.org, Theodor Thornhill <theo@thornhill.no>
Subject: bug#59445: 29.0.50; Tweak tree sitter faces in Java and TypeScript
Date: Tue, 22 Nov 2022 22:31:47 +0000	[thread overview]
Message-ID: <8jAFlf0dCG5QH3h6OnxdRHn-1Hn1n0MRxqOS7DZG5P9FvrZQyB58k5VuIzArBeOWtANYw44vWHXs_8VBbf-2a7Bo7GCjdwESAyMHT4uu9s4=@rjt.dev> (raw)
In-Reply-To: <C7E250D9-48F2-4B72-81D5-F808ED37E580@ucsd.edu>

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@gnu.org> wrote:
> 
> Randy Taylor dev@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@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)





      reply	other threads:[~2022-11-22 22:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 12:13 bug#59445: 29.0.50; Tweak tree sitter faces in Java and TypeScript Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-22  2:39 ` Randy Taylor
2022-11-22 10:08 ` Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-22 22:31   ` Randy Taylor [this message]

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='8jAFlf0dCG5QH3h6OnxdRHn-1Hn1n0MRxqOS7DZG5P9FvrZQyB58k5VuIzArBeOWtANYw44vWHXs_8VBbf-2a7Bo7GCjdwESAyMHT4uu9s4=@rjt.dev' \
    --to=dev@rjt.dev \
    --cc=59445@debbugs.gnu.org \
    --cc=theo@thornhill.no \
    --cc=yuf011@ucsd.edu \
    /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).