mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
feat(xresources): add parser and queries (#7260)
This commit is contained in:
parent
9a94cc23cb
commit
3ba21f96a4
6 changed files with 114 additions and 0 deletions
|
|
@ -878,6 +878,9 @@
|
|||
"xml": {
|
||||
"revision": "809266ed1694d64dedc168a18893cc254e3edf7e"
|
||||
},
|
||||
"xresources": {
|
||||
"revision": "702e1e64ae14635346ffeb945d16f42d009c147a"
|
||||
},
|
||||
"yaml": {
|
||||
"revision": "7b03feefd36b5f155465ca736c6304aca983b267"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2533,6 +2533,15 @@ list.xml = {
|
|||
maintainers = { "@ObserverOfTime" },
|
||||
}
|
||||
|
||||
list.xresources = {
|
||||
install_info = {
|
||||
url = "https://github.com/ValdezFOmar/tree-sitter-xresources",
|
||||
files = { "src/parser.c" },
|
||||
},
|
||||
filetype = "xdefaults",
|
||||
maintainers = { "@ValdezFOmar" },
|
||||
}
|
||||
|
||||
list.yaml = {
|
||||
install_info = {
|
||||
url = "https://github.com/tree-sitter-grammars/tree-sitter-yaml",
|
||||
|
|
|
|||
10
queries/xresources/folds.scm
Normal file
10
queries/xresources/folds.scm
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[
|
||||
(elif_directive)
|
||||
(elifdef_directive)
|
||||
(else_directive)
|
||||
(if_directive)
|
||||
(ifdef_directive)
|
||||
(preprocessor_comment)
|
||||
(comment)+
|
||||
(include_directive)+
|
||||
] @fold
|
||||
75
queries/xresources/highlights.scm
Normal file
75
queries/xresources/highlights.scm
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
[
|
||||
(comment)
|
||||
(preprocessor_comment)
|
||||
] @comment @spell
|
||||
|
||||
"#include" @keyword.import
|
||||
|
||||
[
|
||||
"#define"
|
||||
"#undef"
|
||||
] @keyword.directive.define
|
||||
|
||||
[
|
||||
"#if"
|
||||
"#ifdef"
|
||||
"#ifndef"
|
||||
"#elif"
|
||||
"#elifdef"
|
||||
"#elifndef"
|
||||
"#else"
|
||||
"#endif"
|
||||
(directive)
|
||||
] @keyword.directive
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
(define_directive
|
||||
name: (identifier) @constant.macro)
|
||||
|
||||
(define_function_directive
|
||||
name: (identifier) @function.macro)
|
||||
|
||||
(parameters
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
"..." @variable.parameter.builtin
|
||||
|
||||
(undef_directive
|
||||
name: (identifier) @constant.macro)
|
||||
|
||||
(ifdef_directive
|
||||
condition: (identifier) @constant.macro)
|
||||
|
||||
(elifdef_directive
|
||||
condition: (identifier) @constant.macro)
|
||||
|
||||
(expansion) @markup.raw
|
||||
|
||||
(component) @variable.member
|
||||
|
||||
(components
|
||||
(component) @property .)
|
||||
|
||||
[
|
||||
(string)
|
||||
(resource_value)
|
||||
] @string
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
[
|
||||
"*"
|
||||
(any_component)
|
||||
] @character.special
|
||||
|
||||
[
|
||||
"."
|
||||
","
|
||||
":"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
] @punctuation.bracket
|
||||
5
queries/xresources/injections.scm
Normal file
5
queries/xresources/injections.scm
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
([
|
||||
(comment)
|
||||
(preprocessor_comment)
|
||||
] @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
12
queries/xresources/locals.scm
Normal file
12
queries/xresources/locals.scm
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
(define_directive
|
||||
name: (identifier) @local.definition.macro)
|
||||
|
||||
(define_function_directive
|
||||
name: (identifier) @local.definition.macro)
|
||||
|
||||
(parameters
|
||||
(identifier) @local.definition.parameter)
|
||||
|
||||
(identifier) @local.reference
|
||||
|
||||
(resources) @local.scope
|
||||
Loading…
Add table
Add a link
Reference in a new issue