|
From: | Dmitry Gutov |
Subject: | bug#61655: [Tree sitter] [Feature Request] font-lock function calls, definitions, separately |
Date: | Sat, 25 Feb 2023 15:05:38 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 |
On 25/02/2023 05:59, Randy Taylor wrote:
It is a suitable term, but there is a confusing overlap, at least to me. In C++ parlance, for example, they are referred to as reference variables. I wasn't really getting down to the semantics of it, just when I see something like: void quack(int& thing) ^^^^^ obj_t& thing2 = otherthing; ^^^^^^ Those are the things I would expect font-lock-variable-ref-face to highlight if I was just going off of the name, and I would expect many others to think the same.
That's not unreasonable.
I don't have any better ideas than font-lock-{property,variable}-use-face, so I guess we can see if anyone else has any opinions on the matter.
The only one I could think of is font-lock-{property,variable}-value-face. But that one can give wrong ideas as well.
I suppose we should go with -use-, unless more alternatives are suggested.
Personally, I don't really see the value in differentiating these for variables. I can understand it a little more for properties. But I guess it doesn't hurt to add if folks want it.I see two potential uses: 1. Customize treesit-font-lock-level to 4 but font-lock-variable-ref-face to copy 'default' (or close to it), to skip variable reference highlighting or make it less noticeable.Wouldn't they just remove the variable feature if they want that?
That's the obvious choice (which might be less accessible to those who don't venture into the manual, though, or don't write Elisp), but now they also have the option of toning down the highlights.
2. Pattern matching or comparably complex syntax which at a first glance may look like variable reference, but actually creates new bindings (or vice versa, creates new binding when one wanted to refer to an existing value). Emphasizing the difference can help people, beginners especially [in a particular language].No doubt there are uses, I just don't really see them actually getting much use in practice. But maybe I'm wrong :).
We'll see. I hope we will. Some third-party theme or two might start carrying that distinction, to start with.
It might be nice to improve the default theme in that regard too, but that's a non-trivial task.
[Prev in Thread] | Current Thread | [Next in Thread] |