add highlight support for tree-sitter-query language (tsq) #845
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's a tree-sitter parser for the
.scm
query DSL tree-sitter/tree-sitter-tsq and this PR adds it to the languages, along with highlight queries. Afaik there isn't an LSP for it though.Here's what the highlights look like when highlighted by themselves 😄
(gruvbox theme)
Here are some other examples from more complicated highlights...
The current Elixir highlights (with plenty of fields):
Nix highlights which use a few of what I have scoped as
@operator
sNotably it does (gracefully) fail to parse an escape_sequence in a regexp in the java (edit: and php) highlights:
But I think that's intended behavior: that regex should be
"^_*[A-Z][A-Z\\d_]+$"
in order to be interpreted correctly (separate PR incoming). It happens correctly highlight constants with digits because of the missing$
at the end.(there's a similar regex in the ruby (1) and javascript (2) highlights:)
The scope names in the highlights are pretty subjective and I'm certainly open to debate on all of them :)