mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 02:10:15 -04:00
feat: add properties parser
This commit is contained in:
parent
670e7aa843
commit
6b24db0c8f
6 changed files with 46 additions and 0 deletions
28
queries/properties/highlights.scm
Normal file
28
queries/properties/highlights.scm
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
(comment) @comment @spell
|
||||
|
||||
(key) @property
|
||||
|
||||
(value) @string
|
||||
|
||||
(value (escape) @string.escape)
|
||||
|
||||
((value) @boolean
|
||||
(#any-of? @boolean "true" "false"))
|
||||
|
||||
((value) @number
|
||||
(#lua-match? @number "^%d+$"))
|
||||
|
||||
(index) @number
|
||||
|
||||
(property [ "=" ":" ] @operator)
|
||||
|
||||
[ "${" "}" ] @punctuation.special
|
||||
|
||||
(substitution ":" @punctuation.special)
|
||||
|
||||
[ "[" "]" ] @punctuation.bracket
|
||||
|
||||
[ "." "\\" ] @punctuation.delimiter
|
||||
|
||||
((substitution (key) @constant)
|
||||
(#lua-match? @constant "^[A-Z_][A-Z0-9_]*$"))
|
||||
2
queries/properties/injections.scm
Normal file
2
queries/properties/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
3
queries/properties/locals.scm
Normal file
3
queries/properties/locals.scm
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
(property (key) @definition)
|
||||
|
||||
(substitution (key) @reference)
|
||||
Loading…
Add table
Add a link
Reference in a new issue