-
Currently we have a capture that looks like this:
This will treat any identifier that starts with a uppercase letter as a constant. This will also result in things like Imports being identified as a constant like so:
This will end up being colored like this: Do we like this? Do we want this? What's an alternative? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
At first I thought, odd it would be nice to have the whole import in a single color but after thinking it a bit it is way more readable like this. However if the import does not start with a capital letter I'd like to see it with the same color, as in
The |
Beta Was this translation helpful? Give feedback.
-
Traditional syntax highlighting distinguishes the definition site (e.g. In Strange Loop talk, Max Brunsfeld criticized it starting 6:36
I think that section underlines the design of tree-sitter when used for syntax highlighting, and something both the grammar maintainers and editor integrators should keep in mind. This also highlights the limitation of parser with regards to Scala. In Scala we have namespace for terms and types, and they can each define the same name, often encouraged as "companion object", so at the point of
Coming back to this, I think we should assume uppercased identifiers are of tree-sitter-scala/queries/highlights.scm Lines 9 to 10 in f6bbf35 That would match the |
Beta Was this translation helpful? Give feedback.
Traditional syntax highlighting distinguishes the definition site (e.g.
def foo(x: Int)
) and the use site (e.g.foo(1)
), with regards to the color palette of the symbolfoo
.In Strange Loop talk, Max Brunsfeld criticized it starting 6:36
I think that section underlines the design of tree-sitter when used for syntax highlighting, and something both the grammar maintainers and editor integrators…