mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix(jinja): assign highlights to all variables and functions
The majority of jinja variables aren't assigned any highlights at all. Assign @variable to all identifiers. Jinja filters without parameters are not highlighted as functions: add a query for these. Refine the existing @variable.member to only capture identifiers instead of broader nodes.
This commit is contained in:
parent
1e3b7562c2
commit
20d77c2e5b
4 changed files with 77 additions and 6 deletions
|
|
@ -71,11 +71,7 @@
|
|||
"as"
|
||||
] @keyword.import
|
||||
|
||||
(import_statement
|
||||
(identifier) @variable)
|
||||
|
||||
(import_as
|
||||
(identifier) @variable)
|
||||
(identifier) @variable
|
||||
|
||||
[
|
||||
"if"
|
||||
|
|
@ -109,12 +105,34 @@
|
|||
|
||||
(expression
|
||||
"."
|
||||
(expression)+ @variable.member)
|
||||
(expression
|
||||
(binary_expression
|
||||
.
|
||||
(unary_expression
|
||||
(primary_expression
|
||||
(identifier) @variable.member)))))
|
||||
|
||||
(expression
|
||||
"."
|
||||
(expression
|
||||
(binary_expression
|
||||
(binary_expression
|
||||
(unary_expression
|
||||
(primary_expression
|
||||
(identifier) @variable.member))))))
|
||||
|
||||
(assignment_expression
|
||||
"."
|
||||
(identifier)+ @variable.member)
|
||||
|
||||
; jinja filters
|
||||
(binary_expression
|
||||
(binary_operator
|
||||
"|")
|
||||
(unary_expression
|
||||
(primary_expression
|
||||
(identifier) @function.call)))
|
||||
|
||||
(inline_trans
|
||||
"_" @function.builtin)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue