mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-10 23:40:04 -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
|
; Literals
|
||||||
;---------
|
;---------
|
||||||
|
|
||||||
(this) @variable.builtin
|
|
||||||
(super) @variable.builtin
|
|
||||||
|
|
||||||
(true) @boolean
|
|
||||||
(false) @boolean
|
|
||||||
(null) @constant.builtin
|
|
||||||
[
|
[
|
||||||
(comment)
|
(this)
|
||||||
(hash_bang_line)
|
(super)
|
||||||
|
] @variable.builtin
|
||||||
|
|
||||||
|
[
|
||||||
|
(true)
|
||||||
|
(false)
|
||||||
|
] @boolean
|
||||||
|
|
||||||
|
[
|
||||||
|
(null)
|
||||||
|
(undefined)
|
||||||
|
] @constant.builtin
|
||||||
|
|
||||||
|
[
|
||||||
|
(comment)
|
||||||
|
(hash_bang_line)
|
||||||
] @comment
|
] @comment
|
||||||
|
|
||||||
(string) @string
|
(string) @string
|
||||||
(regex) @punctuation.delimiter
|
|
||||||
(regex_pattern) @string.regex
|
|
||||||
(template_string) @string
|
(template_string) @string
|
||||||
(escape_sequence) @string.escape
|
(escape_sequence) @string.escape
|
||||||
|
(regex_pattern) @string.regex
|
||||||
|
(regex "/" @punctuation.bracket) ; Regex delimiters
|
||||||
|
|
||||||
(number) @number
|
(number) @number
|
||||||
|
((identifier) @number
|
||||||
|
(#any-of? @number "NaN" "Infinity"))
|
||||||
|
|
||||||
; Punctuation
|
; Punctuation
|
||||||
;------------
|
;------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue