Skip to content

Commit

Permalink
Sync queries with nvim-treesitter
Browse files Browse the repository at this point in the history
`nvim-treesitter` has a few updates that it would make sense to bring in:
* Using `@function.call` rather than just `@function`: should fall back
to the more-generic highlight anywhere the specific one isn't supported
* Adding `@spell`: harmless if that isn't recognized

We do retain the one difference around `#match` vs `#lua-match`, since
that was a PR made directly as a divergence.
  • Loading branch information
alex-pinkus committed Oct 9, 2022
1 parent 1fe3cea commit c0d7451
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
(enum_entry ["case" @keyword])

; Function calls
(call_expression (simple_identifier) @function) ; foo()
(call_expression (simple_identifier) @function.call) ; foo()
(call_expression ; foo.bar.baz(): highlight the baz()
(navigation_expression
(navigation_suffix (simple_identifier) @function)))
(navigation_suffix (simple_identifier) @function.call)))
((navigation_expression
(simple_identifier) @type) ; SomeType.method(): highlight SomeType as a type
(#match? @type "^[A-Z]"))
Expand Down Expand Up @@ -96,8 +96,10 @@
(statement_label) @label

; Comments
(comment) @comment
(multiline_comment) @comment
[
(comment)
(multiline_comment)
] @comment @spell

; String literals
(line_str_text) @string
Expand Down

0 comments on commit c0d7451

Please sign in to comment.