all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Vincenzo Pupillo <v.pupillo@gmail.com>
Cc: 64647@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
	jostein@kjonigsen.net
Subject: bug#64647: treesit-query-error due to a recent change to tree-sitter-javascript grammar definition
Date: Sat, 15 Jul 2023 22:45:31 +0200	[thread overview]
Message-ID: <871qh8sy38.fsf@thornhill.no> (raw)
In-Reply-To: <2891516.e9J7NaK4W3@fedora> (Vincenzo Pupillo's message of "Sat,  15 Jul 2023 21:39:49 +0200")

Vincenzo Pupillo <v.pupillo@gmail.com> writes:

> In data sabato 15 luglio 2023 21:16:42 CEST, Eli Zaretskii ha scritto:
>> > From: Theodor Thornhill <theo@thornhill.no>
>> > Cc: Vincenzo Pupillo <v.pupillo@gmail.com>,  Jostein Kjonigsen
>> > 
>> >  <jostein@kjonigsen.net>,  64647@debbugs.gnu.org
>> > 
>> > Date: Sat, 15 Jul 2023 19:54:03 +0200
>> > 
>> > Eli Zaretskii <eliz@gnu.org> writes:
>> > >> The patch in attachment fixes both problems.
>> > > 
>> > > Will the patch work with the grammar libraries before the recent
>> > > change?
>> > 
>> > It will introduce regressions, but the patch itself is a change for the
>> > better, both in emacs land and in the grammar itself.
>> 
>> What kinds of regressions?
>> 

Because the nodes seems to have been removed/swapped in for new ones, we
will lose the functionality for people using versions < bb1f97b6.

>> > I don't disagree, but I think this is a difficult problem to solve, but
>> > with an easy cop-out solution that most other implementors use - just
>> > refer to the last supported commit. We've had some discussions on this,
>> > but IIRC we never settled on anything. Personally, I think a
>> > 
>> > ;;; Tree-sitter-version: bb1f97b643b77fc1f082d621bf533b4b14cf0c30
>> > 
>> > header may be the simplest way to at least signal some awareness
>> > here. That way the auto install mechanism can pull that hash directly
>> > and we can ensure some sort of compatibility checking.
>> > 
>> > What do you think?
>> 
>> I think what I wrote: that we should try to make our modes work with
>> reasonably old versions of the grammars, if that is practical.  While
>> in general it could be a very difficult, if not impossible, to achieve
>> that, the question is whether this particular issue can be solved in
>> that manner.  If it can, we should do it.

Yeah, I think we can do that in this case. I'm just wondering whether
it's worth the effort or not. Should we introduce some notion of
"deprecated" tree sitter functionalities? Otherwise I guess we'll have
to maintain a growing set of compat-code, which over time will incur a
performance cost, and it may be difficult to remember what code is
compat-code and what isn't. 

> I can rewrite both patches in the same way I had patched java-ts-mode. 
> Basically, there are only two changes. I think it would be useful to have a 
> function to check whether grammar features are supported or not. For example, 
> a specialized version of treesit-query-validate that could also be used in 
> interactive mode (to simplify the development).
>
> Do I rewrite the patches?

I seem to have missed the java-ts-mode patch. Where is it? Do you have
such an implementation ready at hand? To me it sounds smart to have such
a function, and it sounds like it should be in treesit.el, but that
would probably be too late for emacs-29, I think?

Do you want to write such a function Vincenzo?

Theo





  reply	other threads:[~2023-07-15 20:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-15 12:34 bug#64647: treesit-query-error due to a recent change to tree-sitter-javascript grammar definition Vincenzo Pupillo
2023-07-15 12:57 ` Eli Zaretskii
2023-07-15 13:23   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-15 17:54   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-15 19:16     ` Eli Zaretskii
2023-07-15 19:39       ` Vincenzo Pupillo
2023-07-15 20:45         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-07-16  5:13           ` Eli Zaretskii
2023-07-16  8:38             ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-16 18:00               ` Vincenzo Pupillo
2023-07-16 18:19                 ` bug#64647: " Eli Zaretskii
2023-07-16 18:56                   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-17 21:24                   ` Vincenzo Pupillo
2023-07-19  5:11                     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-20 10:14                       ` Vincenzo Pupillo
2023-07-22  6:41                         ` bug#64647: " Eli Zaretskii
2023-07-22  7:29                           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-22  8:52                             ` Eli Zaretskii
2023-07-22 11:56                         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-22 14:10                           ` Vincenzo Pupillo
2023-07-22 21:22                             ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-22 22:59                               ` Yuan Fu
2023-07-23  5:17                               ` Eli Zaretskii
2023-07-16  4:48         ` bug#64647: " Eli Zaretskii
2023-07-15 19:17     ` Vincenzo Pupillo
2023-07-15 20:51       ` 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=871qh8sy38.fsf@thornhill.no \
    --to=bug-gnu-emacs@gnu.org \
    --cc=64647@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jostein@kjonigsen.net \
    --cc=theo@thornhill.no \
    --cc=v.pupillo@gmail.com \
    /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.