mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
highlights(ecma): Update queries for literals
- Add queries for value properties:
- undefined
- NaN
- Infinity
- Highlight regex delimiters as brackets instead of punctuation
- Format queries for literals
This commit is contained in:
parent
4b536a9709
commit
fb6d60c7b9
1 changed files with 23 additions and 10 deletions
|
|
@ -97,22 +97,35 @@
|
|||
; Literals
|
||||
;---------
|
||||
|
||||
(this) @variable.builtin
|
||||
(super) @variable.builtin
|
||||
|
||||
(true) @boolean
|
||||
(false) @boolean
|
||||
(null) @constant.builtin
|
||||
[
|
||||
(comment)
|
||||
(hash_bang_line)
|
||||
(this)
|
||||
(super)
|
||||
] @variable.builtin
|
||||
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
] @boolean
|
||||
|
||||
[
|
||||
(null)
|
||||
(undefined)
|
||||
] @constant.builtin
|
||||
|
||||
[
|
||||
(comment)
|
||||
(hash_bang_line)
|
||||
] @comment
|
||||
|
||||
(string) @string
|
||||
(regex) @punctuation.delimiter
|
||||
(regex_pattern) @string.regex
|
||||
(template_string) @string
|
||||
(escape_sequence) @string.escape
|
||||
(regex_pattern) @string.regex
|
||||
(regex "/" @punctuation.bracket) ; Regex delimiters
|
||||
|
||||
(number) @number
|
||||
((identifier) @number
|
||||
(#any-of? @number "NaN" "Infinity"))
|
||||
|
||||
; Punctuation
|
||||
;------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue