mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
fix(javascript): fix constant variable highlight
The `@constant` query gets overwritten by the `@constructor` query. They both query for variables starting with an uppercase letter, but the `@constant` query took effect first.
This commit is contained in:
parent
d1796695ac
commit
31fca67839
1 changed files with 3 additions and 3 deletions
|
|
@ -17,15 +17,15 @@
|
||||||
|
|
||||||
(identifier) @variable
|
(identifier) @variable
|
||||||
|
|
||||||
|
((identifier) @constructor
|
||||||
|
(#match? @constructor "^[A-Z]"))
|
||||||
|
|
||||||
((identifier) @constant
|
((identifier) @constant
|
||||||
(#vim-match? @constant "^[A-Z_][A-Z\\d_]+$"))
|
(#vim-match? @constant "^[A-Z_][A-Z\\d_]+$"))
|
||||||
|
|
||||||
((shorthand_property_identifier) @constant
|
((shorthand_property_identifier) @constant
|
||||||
(#vim-match? @constant "^[A-Z_][A-Z\\d_]+$"))
|
(#vim-match? @constant "^[A-Z_][A-Z\\d_]+$"))
|
||||||
|
|
||||||
((identifier) @constructor
|
|
||||||
(#match? @constructor "^[A-Z]"))
|
|
||||||
|
|
||||||
((identifier) @variable.builtin
|
((identifier) @variable.builtin
|
||||||
(#vim-match? @variable.builtin "^(arguments|module|console|window|document)$"))
|
(#vim-match? @variable.builtin "^(arguments|module|console|window|document)$"))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue