emacs-devel
[Top][All Lists]
Advanced

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

Re: Standardizing tree-sitter fontification features


From: Stefan Monnier
Subject: Re: Standardizing tree-sitter fontification features
Date: Thu, 24 Nov 2022 21:56:32 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> Basic tokens:
>
> delimiter       ,.;
> operator        = != ||

>From the grammar point of view, both of these are simply infix thingies.
Defining precisely the difference between them can be a bit more
delicate, tho.  I guess intuitively the idea is that "operator"
corresponds to some kind of run-time operation whereas "delimiter"
serves only to figure out where things start and end but doesn't do
anything in itself.

Not clear where the `=` used for definitions (as in "let x = foo in
bar") should fall.  Same for the "," used to construct pairs
or the conjunction/disjunction in Prolog written `,` and `;`
respectively :-)

> string-interpolation    f"text {variable}"
> escape-sequence         "\n\t\\"
> function                every function identifier

I think we definitely need to distinguish a reference/use of a function
from a definition of a function.  I do want my function identifiers
highlighted in my function definitions but *not* in my function calls.

> variable                every variable identifier

Same here.
[ Note that in many languages (e.g. Scheme and C), functions and
  "variables" are the same (i.e. Lisp-1 in the world of Lisp).  ]

> type                    every type identifier

And same here as well.
[ I will spare you the discussion of what should happen for dependently
  typed languages where types are "normal" values.  ]

> Also, some of the features are very busy, it would be good if we can disable
> they by default. The default value of font-lock-maximum-decoration is t,
> meaning use everything, which is not very helpful...

If you compare the "style" of font-lock rules used until now to those
provide in the new tree-sitter modes, I think it makes sense for
tree-sitter modes to default to "medium" decorations.


        Stefan




reply via email to

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