From: Eli Zaretskii <eliz@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: dmitry@gutov.dev, daanturo@gmail.com, 72573@debbugs.gnu.org
Subject: bug#72573: 29.4; js-mode/JSX: forward-sexp behavior at end of string in JSX fragments
Date: Sat, 24 Aug 2024 11:32:05 +0300 [thread overview]
Message-ID: <86ikvqnwxm.fsf@gnu.org> (raw)
In-Reply-To: <86cym5jakl.fsf@mail.linkov.net> (message from Juri Linkov on Mon, 19 Aug 2024 09:42:50 +0300)
> From: Juri Linkov <juri@linkov.net>
> Cc: Eli Zaretskii <eliz@gnu.org>, 72573@debbugs.gnu.org, daanturo@gmail.com
> Date: Mon, 19 Aug 2024 09:42:50 +0300
>
> >>>>> I don't think there's much we can do in js-mode (or js-jsx-mode).
> >>>>
> >>>> So you suggest to close this as wontfix?
> >>>
> >>> Probably, yes.
> >>>
> >>> But IIRC we had another bug# where somebody also requested a different
> >>> behavior for forward-sexp. So they could be merged.
> >> Sure, if you know the number, we should merge them.
> >
> > Hmm, forward-sexp's inside strings behavior (and paredit) were last
> > mentioned in https://debbugs.gnu.org/67036#20, but it has a longer list of
> > issues and considerations inside, so maybe not a duplicate.
>
> The solution in bug#67036 was for tree-sitter that in case of
> <h1 className="cacaca|"> just moves out of the string.
> After applying this patch, it will still do the same
> because "string_fragment" is inside quotes,
> while allowing the default behavior inside the string
> because tree-sitter can't look inside:
>
> diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
> index 75c8111035c..6c1223f36fa 100644
> --- a/lisp/progmodes/js.el
> +++ b/lisp/progmodes/js.el
> @@ -3929,7 +3929,8 @@ js-ts-mode
> (sexp ,(js--regexp-opt-symbol js--treesit-sexp-nodes))
> (sentence ,(js--regexp-opt-symbol js--treesit-sentence-nodes))
> (text ,(js--regexp-opt-symbol '("comment"
> - "template_string"))))))
> + "template_string"
> + "string_fragment"))))))
>
> But since this bug report about the default non-ts behavior,
> I have no idea why the default forward-sexp-function moves to
> the beginning of the next string. Maybe this was implemented
> because the default ad-hoc syntax parsing is not reliable and might
> mix up string beginnings and endings. tree-sitter has no such problem.
So what is our way forward with this? Should we install the above
patch, or should we close this bug ans wontfix?
next prev parent reply other threads:[~2024-08-24 8:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-11 9:33 bug#72573: 29.4; js-mode/JSX: forward-sexp behavior at end of string in JSX fragments Daan Ro
2024-08-15 7:54 ` Eli Zaretskii
2024-08-18 13:37 ` Dmitry Gutov
2024-08-18 13:42 ` Eli Zaretskii
2024-08-18 14:11 ` Dmitry Gutov
2024-08-18 14:16 ` Eli Zaretskii
2024-08-18 20:19 ` Dmitry Gutov
2024-08-19 6:42 ` Juri Linkov
2024-08-24 8:32 ` Eli Zaretskii [this message]
2024-08-24 9:34 ` Daan Ro
2024-08-31 9:26 ` Eli Zaretskii
2024-09-01 17:02 ` Juri Linkov
2024-09-14 7:39 ` Eli Zaretskii
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=86ikvqnwxm.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=72573@debbugs.gnu.org \
--cc=daanturo@gmail.com \
--cc=dmitry@gutov.dev \
--cc=juri@linkov.net \
/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.