unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#73324: 30.0.91; php-ts-mode: regression due to the latest patches for treesitter.c?
@ 2024-09-17 20:29 Vincenzo Pupillo
  2024-09-17 20:35 ` Vincenzo Pupillo
  2024-09-18  4:26 ` Yuan Fu
  0 siblings, 2 replies; 4+ messages in thread
From: Vincenzo Pupillo @ 2024-09-17 20:29 UTC (permalink / raw)
  To: 73324

[-- Attachment #1: Type: text/plain, Size: 1113 bytes --]

Ciao,
php-ts-mode no longer behaves as it used to. There seems to be some problems 
with the calculation of ranges covered by the parsers. In the image I attached 
you can see how the code is being parsed by both the php and javascript 
parsers. The namespace declaration has some elements colored as if they were 
escape sequences.
The php-ts-mode--get-parser-ranges function returns the following ranges:

((#<treesit-parser for html> nil) (#<treesit-parser for css> nil) (#<treesit-
parser for javascript> nil) (#<treesit-parser for php> nil) (#<treesit-parser 
for phpdoc> ((368 . 426))) (#<treesit-parser for jsdoc> ((368 . 426))))

The range for 'jsdoc' is wrong, there should be only the range for 'phpdoc'.
The attached gif screencast shows the strange behavior in updating the font-
lock.
It doesn't happen all the time. I'm trying to isolate the problem.

Any ideas about this?
The parsers were installed with php-ts-mode-install-parser.

GNU Emacs 30.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo 
version 1.18.0) of 2024-09-17, libtree-sitter-0.22.5-1.fc40.x86_64


Thanks.

Vincenzo

[-- Attachment #2: range_issue_1.png --]
[-- Type: image/png, Size: 34926 bytes --]

[-- Attachment #3: reange_issue_2.gif --]
[-- Type: image/gif, Size: 104893 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#73324: 30.0.91; php-ts-mode: regression due to the latest patches for treesitter.c?
  2024-09-17 20:29 bug#73324: 30.0.91; php-ts-mode: regression due to the latest patches for treesitter.c? Vincenzo Pupillo
@ 2024-09-17 20:35 ` Vincenzo Pupillo
  2024-09-18  4:26 ` Yuan Fu
  1 sibling, 0 replies; 4+ messages in thread
From: Vincenzo Pupillo @ 2024-09-17 20:35 UTC (permalink / raw)
  To: 73324; +Cc: Vincenzo Pupillo

[-- Attachment #1: Type: text/plain, Size: 1317 bytes --]

Sorry, I forgot to attach the php file.

In data martedì 17 settembre 2024 22:29:14 CEST, Vincenzo Pupillo ha scritto:
> Ciao,
> php-ts-mode no longer behaves as it used to. There seems to be some problems
> with the calculation of ranges covered by the parsers. In the image I
> attached you can see how the code is being parsed by both the php and
> javascript parsers. The namespace declaration has some elements colored as
> if they were escape sequences.
> The php-ts-mode--get-parser-ranges function returns the following ranges:
> 
> ((#<treesit-parser for html> nil) (#<treesit-parser for css> nil)
> (#<treesit- parser for javascript> nil) (#<treesit-parser for php> nil)
> (#<treesit-parser for phpdoc> ((368 . 426))) (#<treesit-parser for jsdoc>
> ((368 . 426))))
> 
> The range for 'jsdoc' is wrong, there should be only the range for 'phpdoc'.
> The attached gif screencast shows the strange behavior in updating the
> font- lock.
> It doesn't happen all the time. I'm trying to isolate the problem.
> 
> Any ideas about this?
> The parsers were installed with php-ts-mode-install-parser.
> 
> GNU Emacs 30.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo
> version 1.18.0) of 2024-09-17, libtree-sitter-0.22.5-1.fc40.x86_64
> 
> 
> Thanks.
> 
> Vincenzo


[-- Attachment #2: namespace.php --]
[-- Type: application/x-php, Size: 478 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#73324: 30.0.91; php-ts-mode: regression due to the latest patches for treesitter.c?
  2024-09-17 20:29 bug#73324: 30.0.91; php-ts-mode: regression due to the latest patches for treesitter.c? Vincenzo Pupillo
  2024-09-17 20:35 ` Vincenzo Pupillo
@ 2024-09-18  4:26 ` Yuan Fu
  2024-09-18 10:16   ` Vincenzo Pupillo
  1 sibling, 1 reply; 4+ messages in thread
From: Yuan Fu @ 2024-09-18  4:26 UTC (permalink / raw)
  To: Vincenzo Pupillo; +Cc: 73324



> On Sep 17, 2024, at 1:29 PM, Vincenzo Pupillo <v.pupillo@gmail.com> wrote:
> 
> Ciao,
> php-ts-mode no longer behaves as it used to. There seems to be some problems 
> with the calculation of ranges covered by the parsers. In the image I attached 
> you can see how the code is being parsed by both the php and javascript 
> parsers. The namespace declaration has some elements colored as if they were 
> escape sequences.
> The php-ts-mode--get-parser-ranges function returns the following ranges:
> 
> ((#<treesit-parser for html> nil) (#<treesit-parser for css> nil) (#<treesit-
> parser for javascript> nil) (#<treesit-parser for php> nil) (#<treesit-parser 
> for phpdoc> ((368 . 426))) (#<treesit-parser for jsdoc> ((368 . 426))))
> 
> The range for 'jsdoc' is wrong, there should be only the range for 'phpdoc'.
> The attached gif screencast shows the strange behavior in updating the font-
> lock.
> It doesn't happen all the time. I'm trying to isolate the problem.
> 
> Any ideas about this?
> The parsers were installed with php-ts-mode-install-parser.
> 
> GNU Emacs 30.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo 
> version 1.18.0) of 2024-09-17, libtree-sitter-0.22.5-1.fc40.x86_64
> 
> 
> Thanks.
> 
> Vincenzo<range_issue_1.png><reange_issue_2.gif>

I couldn’t reproduce this but I have some suspicion. I pushed a change to emacs-30, please try to use that and see if you can still occasionally reproduce. Thanks! And sorry for breaking it :-)

Yuan




^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#73324: 30.0.91; php-ts-mode: regression due to the latest patches for treesitter.c?
  2024-09-18  4:26 ` Yuan Fu
@ 2024-09-18 10:16   ` Vincenzo Pupillo
  0 siblings, 0 replies; 4+ messages in thread
From: Vincenzo Pupillo @ 2024-09-18 10:16 UTC (permalink / raw)
  To: Yuan Fu; +Cc: 73324

[-- Attachment #1: Type: text/plain, Size: 2085 bytes --]

In data mercoledì 18 settembre 2024 06:26:40 CEST, Yuan Fu ha scritto:
> 
> > On Sep 17, 2024, at 1:29 PM, Vincenzo Pupillo <v.pupillo@gmail.com> wrote:
> > 
> > Ciao,
> > php-ts-mode no longer behaves as it used to. There seems to be some problems 
> > with the calculation of ranges covered by the parsers. In the image I attached 
> > you can see how the code is being parsed by both the php and javascript 
> > parsers. The namespace declaration has some elements colored as if they were 
> > escape sequences.
> > The php-ts-mode--get-parser-ranges function returns the following ranges:
> > 
> > ((#<treesit-parser for html> nil) (#<treesit-parser for css> nil) (#<treesit-
> > parser for javascript> nil) (#<treesit-parser for php> nil) (#<treesit-parser 
> > for phpdoc> ((368 . 426))) (#<treesit-parser for jsdoc> ((368 . 426))))
> > 
> > The range for 'jsdoc' is wrong, there should be only the range for 'phpdoc'.
> > The attached gif screencast shows the strange behavior in updating the font-
> > lock.
> > It doesn't happen all the time. I'm trying to isolate the problem.
> > 
> > Any ideas about this?
> > The parsers were installed with php-ts-mode-install-parser.
> > 
> > GNU Emacs 30.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo 
> > version 1.18.0) of 2024-09-17, libtree-sitter-0.22.5-1.fc40.x86_64
> > 
> > 
> > Thanks.
> > 
> > Vincenzo<range_issue_1.png><reange_issue_2.gif>
> 
> I couldn’t reproduce this but I have some suspicion. I pushed a change to emacs-30, please try to use that and see if you can still occasionally reproduce. Thanks! And sorry for breaking it :-)

Thank you Yuan! 

It works better, but the range update seems to be delayed or not triggered by e.g. yank or undo, as you can see in the attached screencast.
After the yank the ranges are:
((#<treesit-parser for html> ((2 . 483))) (#<treesit-parser for css> ((1 . 1))) (#<treesit-parser for javascript> ((1 . 1))) (#<treesit-parser for php> nil) (#<treesit-parser for phpdoc> ((377 . 435))))

Vincenzo

> 
> Yuan
> 

[-- Attachment #2: range_issue_3.gif --]
[-- Type: image/gif, Size: 234199 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-18 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-17 20:29 bug#73324: 30.0.91; php-ts-mode: regression due to the latest patches for treesitter.c? Vincenzo Pupillo
2024-09-17 20:35 ` Vincenzo Pupillo
2024-09-18  4:26 ` Yuan Fu
2024-09-18 10:16   ` Vincenzo Pupillo

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).