GNU bug report logs -
#63708
29.0.60; rust-ts-mode not properly handling apostrophe
Previous Next
Reported by: Йордан Миладинов <yordanm <at> proton.me>
Date: Thu, 25 May 2023 03:58:02 UTC
Severity: normal
Merged with 63709
Found in version 29.0.60
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Monday, May 29th, 2023 at 07:25, Eli Zaretskii <eliz <at> gnu.org> wrote:
> > Date: Sun, 28 May 2023 19:52:38 +0000
>
> > From: Йордан Миладинов yordanm <at> proton.me
> > Cc: Eli Zaretskii eliz <at> gnu.org, 63708 <at> debbugs.gnu.org, casouri <at> gmail.com
> > (while (re-search-forward (rx (or "<" ">")) end t)
> > - (pcase (treesit-node-type
> > - (treesit-node-parent
> > - (treesit-node-at (match-beginning 0))))
> > - ("type_arguments"
> > - (put-text-property (match-beginning 0)
> > - (match-end 0)
> > - 'syntax-table
> > - (pcase (char-before)
> > - (?< '(4 . ?>))
> > - (?> '(5 . ?<))))))))
> > + (let ((parent-type (treesit-node-type
> > + (treesit-node-parent
> > + (treesit-node-at (match-beginning 0))))))
> > + (when (or (string-equal parent-type "type_arguments")
> > + (string-equal parent-type "type_parameters"))
> > + (put-text-property (match-beginning 0)
> > + (match-end 0)
> > + 'syntax-table
> > + (pcase (char-before)
> > + (?< '(4 . ?>))
> > + (?> '(5 . ?<))))))))
>
>
> Here, AFAIU you needed to add a single line, but instead you rewrote a
> 'pcase' as a 'when', and got a much larger change. Was that really
> needed?
>
I think keeping the existing loop as is but making a slight modification:
- ("type_arguments"
+ ((or "type_arguments" "type_parameters")
should be enough?
> I also don't understand how a bug for go-ts-mode led to a change that
> also affects rust-ts-mode. Can you explain?
>
The go-ts-mode change does not affect rust-ts-mode. The same bug is present in go-ts-mode.
This bug report was last modified 1 year and 355 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.