Distinguish literal values from constant identifiers in queries #7440
-
The query capture It'd be better if these two uses weren't conflated. Literals should all default to a common capture, but constant identifiers should default to the highlight of identifiers, or have one of their own. So instead of the current hierarchy:
We'd have:
And manually check the remaining Other alternatives to the name I've only started to use helix recently, but if this proposal is accepted, I'd be interested in contributing the changes myself. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
We generally follow textmate for scope names which also uses Rebranding values as Changing to I don't think it's worth the breaking change it would cause to themes and queries. |
Beta Was this translation helpful? Give feedback.
-
Sure, the idea would be to differentiate the cases where that's really true from the cases where being constant is just a convention (like in Python). I thought Helix —being a newer editor— had a bit more flexibility here, but using the naming conventions of a more mature editor makes sense. |
Beta Was this translation helpful? Give feedback.
We generally follow textmate for scope names which also uses
@constant
: https://macromates.com/manual/en/language_grammars#naming_conventions.Rebranding values as
@literal
makes sense to me but I think it's a fair (although debatable) interpretation to say that constant identifiers are closer@constant
s than identifiers: they're effectively the same as having a literal value in their place.Changing to
@literal
also wouldn't really enable any new functionality: you can already highlight values by defining the necessary theme keys; it would just make that easier.I don't think it's worth the breaking change it would cause to themes and queries.