[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Standardizing tree-sitter fontification features

From: Yuan Fu
Subject: Re: Standardizing tree-sitter fontification features
Date: Fri, 2 Dec 2022 17:12:20 -0800

[Addint emacs-devel back]

> On Nov 25, 2022, at 3:20 AM, Mattias Engdegård <mattias.engdegard@gmail.com> 
> wrote:
>> Right now we have:
> [...]
>> comment
> What about treating doc-comments as a separate case?
> (May also want to fontify various parts inside, such as doc mark-up elements.)

That makes me wonder what should we do with string & docstrings & 
string-interpolation. Should we make them all separate features, or put them 
all in a single “string” feature, or have some major mode variable to turn 
things on/off?

My thoughts:
- docstring is pretty standard for a given language, so they can probably 
enabled by default and be part of the string feature.
- string interpolation could be part of string feature, but since “string” 
feature is enabled at pretty low fontification level, I decided to make it 
separate, and only enabled it in higher fontification levels.
- doc-comment seems rather non-standards, and could even be different from 
project to project. So I tend to think it should be turned on/off by a major 
mode variable in major modes that support this feature. And user can 
enable/disable it with dir-local or file-local variables.

> Otherwise I mostly agree with the proposal but fear that it may result in an 
> overly busy scheme. Colour only really helps when it helps highlighting 
> structure, not contents.

I agree, that’s why we don’t enable all the features by default. The default 
fontification should be pretty sane (IMO).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]