[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Initial fontification in sh-mode with tree-sittter
From: |
Daniel Martín |
Subject: |
Re: Initial fontification in sh-mode with tree-sittter |
Date: |
Tue, 01 Nov 2022 01:09:00 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) |
Yuan Fu <casouri@gmail.com> writes:
>
> I think I’ve fixed this problem. It is mainly due to how the
> fortifications rule is written. When the starting quotes are inserted,
> normal syntactic font-lock will mark everything behind it in
> string-face, but for tree-sitter, since the source is incomplete, the
> quotes are in an error node in the parse tree and there is no string
> node, so tree-sitter rules can’t capture any string node, so no string
> face is applied. And when the ending quotes are inserted, the only
> region jit-lock wants tree-sitter to fontify is that three quote, so
> again the whole string is not captured. I changed the font-lock rule
> to match the ending quote rather than the whole string, and now it’s
> working fine.
>
> Now it is actually better than before: If you insert an open quote,
> the rest of the buffer will not be marked in string face, instead, and
> when you insert the ending quote, the string is fontified correctly.
>
I can still reproduce the problem, with same reproduction steps that I
mentioned before.
Curiously, as soon as I press C-l, the text gets fontified with the
string face.
- Initial fontification in sh-mode with tree-sittter, João Paulo Labegalini de Carvalho, 2022/10/27
- Re: Initial fontification in sh-mode with tree-sittter, João Paulo Labegalini de Carvalho, 2022/10/27
- Re: Initial fontification in sh-mode with tree-sittter, João Paulo Labegalini de Carvalho, 2022/10/27
- Re: Initial fontification in sh-mode with tree-sittter, Yuan Fu, 2022/10/28
- Re: Initial fontification in sh-mode with tree-sittter, Daniel Martín, 2022/10/28
- Re: Initial fontification in sh-mode with tree-sittter, Yuan Fu, 2022/10/30
- Re: Initial fontification in sh-mode with tree-sittter, Yuan Fu, 2022/10/31
- Re: Initial fontification in sh-mode with tree-sittter,
Daniel Martín <=
- Re: Initial fontification in sh-mode with tree-sittter, Yuan Fu, 2022/10/31
Re: Initial fontification in sh-mode with tree-sittter, Stefan Kangas, 2022/10/27
Re: Initial fontification in sh-mode with tree-sittter, João Paulo Labegalini de Carvalho, 2022/10/28
- Re: Initial fontification in sh-mode with tree-sittter, Stefan Kangas, 2022/10/28
- Re: Initial fontification in sh-mode with tree-sittter, Stefan Monnier, 2022/10/28
- Re: Initial fontification in sh-mode with tree-sittter, Theodor Thornhill, 2022/10/28
- Re: Initial fontification in sh-mode with tree-sittter, João Paulo Labegalini de Carvalho, 2022/10/28
- Re: Initial fontification in sh-mode with tree-sittter, Stefan Monnier, 2022/10/28
- Re: Initial fontification in sh-mode with tree-sittter, Yuan Fu, 2022/10/28