mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix(ecma): properly capture constants in const declarations
This commit is contained in:
parent
88c490f00f
commit
c553e6c560
1 changed files with 7 additions and 2 deletions
|
|
@ -24,10 +24,15 @@
|
|||
(#lua-match? @type "^[A-Z]"))
|
||||
|
||||
((identifier) @constant
|
||||
(#lua-match? @constant "^[A-Z_][A-Z%d_]+$"))
|
||||
(#lua-match? @constant "^_*[A-Z][A-Z%d_]*$"))
|
||||
|
||||
((shorthand_property_identifier) @constant
|
||||
(#lua-match? @constant "^[A-Z_][A-Z%d_]+$"))
|
||||
(#lua-match? @constant "^_*[A-Z][A-Z%d_]*$"))
|
||||
|
||||
(lexical_declaration
|
||||
"const"
|
||||
. (variable_declarator
|
||||
. name: (identifier) @constant))
|
||||
|
||||
((identifier) @variable.builtin
|
||||
(#vim-match? @variable.builtin "^(arguments|module|console|window|document)$"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue