Tree-sitter became more widespread and Emacs took notice and included a bunch of -ts-mode as alternatives to -mode into the core. This is good news and a welcome change, but I have some concerns about the approach.
When I first saw the Tree-sitter talk by Max Brunsfeld I was concerned that the language highlighting “fix” they’re talking about is too much.
That’s a misinterpretation of my argument. I said monochromacity: that at the highest level, many disparate node types are font locked with the same face. Try it in Python. Everything is the same shade of whatever your variable name face is.
So your complaint is about the non-default behavior? The level 3 was chosen as default explicitly to avoid the abundance of color where it’s not really needed.
I said monochromacity: that at the highest level, many disparate node types are font locked with the same face. Try it in Python. Everything is the same shade of whatever your variable name face is.
I don’t see that “everything is the same shade”, even with level 4. There are problems - like the variable matches in particular (which is not useful IMO, but should at least use a different face). The rest use different faces, but since most of those faces are new, it’s up to the theme authors to differentiate them.
Here’s a patch fixing the one problem I found (try it), and below is a screenshot with this patch applied along with the new faces customized to be distinct.
So your complaint is about the non-default behavior? The level 3 was chosen as default explicitly to avoid the abundance of color where it’s not really needed.
That’s not what I wrote.
I don’t see that “everything is the same shade”, even with level 4. There are problems - like the variable matcher in particular (which is not useful IMO, but should at least use a different face).
The variable matcher, indeed, is the one I was talking about…
That’s a misinterpretation of my argument. I said monochromacity: that at the highest level, many disparate node types are font locked with the same face. Try it in Python. Everything is the same shade of whatever your variable name face is.
So your complaint is about the non-default behavior? The level 3 was chosen as default explicitly to avoid the abundance of color where it’s not really needed.
I don’t see that “everything is the same shade”, even with level 4. There are problems - like the
variable
matches in particular (which is not useful IMO, but should at least use a different face). The rest use different faces, but since most of those faces are new, it’s up to the theme authors to differentiate them.Here’s a patch fixing the one problem I found (try it), and below is a screenshot with this patch applied along with the new faces customized to be distinct.
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index d3cb5a77e22..9f9344e0eb4 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1235,7 +1235,7 @@ python--treesit-fontify-variable (when (python--treesit-variable-p node) (treesit-fontify-with-override (treesit-node-start node) (treesit-node-end node) - 'font-lock-variable-name-face override start end))) + 'font-lock-variable-use-face override start end))) ;;; Indentation
https://imgur.com/a/iifAmcd
That’s not what I wrote.
The variable matcher, indeed, is the one I was talking about…
I’m glad we’re on the same page.
You’re welcome.