Thanks Yuan, now work correctly. V. In data mercoledì 31 gennaio 2024 07:32:47 CET, Yuan Fu ha scritto: > > On Jan 29, 2024, at 6:04 AM, Vincenzo Pupillo wrote: > > > > Hi Yuan, > > > > In data domenica 28 gennaio 2024 08:09:02 CET, Yuan Fu ha scritto: > >> Actually, local parsers are not included in the return value of > >> (treesit-parser-list). By default, treesit-parser-list returns all the > >> parsers whose tag is nil, but all the local parsers carry a tag of > >> ‘embedded. To actually return all the parsers in the buffer you need to > >> use > >> (treesit-parser-list nil nil t), ie, pass t to the TAG parameter. > >> > >> I pulled your php-ts-mode_phpdoc.el and played around with it. I found > >> the > >> root cause to be the call to > >> > >> (treesit-parser-create ‘phpdoc) > >> > >> In the major mode body. This creates a global phpdoc parser that > >> fontifies > >> everything in doc face. > >> > >> Removing that, plus the fix for #1 that I just pushed to master, should > >> fix > >> the font-lock problem you are observing. > > > > It seems to work, but just try to indent the entire buffer, and the > > problem > > reappears. Before indenting: > > ((# ((1 . 271))) (# ((161 > > . 223))) (# ((73 . 138))) > > (# nil) (# ((517 . > > 621))) (# ((672 . 810))) (# > phpdoc> ((939 . 1032))) (# ((1157 . 1223)))) > > > > after indenting the whole buffer: > > > > ((# ((1 . 271))) (# ((161 > > . 223))) (# ((73 . 138))) > > (# nil) (# ((517 . > > 621))) (# ((672 . 810))) (# > phpdoc> ((939 . 1032))) (# ((1157 . 1223))) > > (# nil)) > > > > As you can see the list of parsers has changed, and the latest one is: > > (# nil) . > > > > To reproduce the problem: > > 1. open a php file (for e.g. the php file attached) > > 2. Indent the entire buffer > > 3. add a comment line inside a document block > > > > The attached screenshot shows the result. > > That’s due to a bug in treesit--indent-1. I’ve pushed a fix for it to > master. It should solve your problem. BTW, you don’t need to call > flush-syntax-ppss anymore, we fixed that bug a while back. > > Yuan