mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 03:40:04 -04:00
feat: add Kconfig
This commit is contained in:
parent
8e9cc89955
commit
f8c2825220
8 changed files with 132 additions and 0 deletions
|
|
@ -271,6 +271,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
||||||
- [x] [JSON with comments](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git) (maintained by @WhyNotHugo)
|
- [x] [JSON with comments](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git) (maintained by @WhyNotHugo)
|
||||||
- [x] [jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) (maintained by @nawordar)
|
- [x] [jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) (maintained by @nawordar)
|
||||||
- [x] [julia](https://github.com/tree-sitter/tree-sitter-julia) (maintained by @theHamsta)
|
- [x] [julia](https://github.com/tree-sitter/tree-sitter-julia) (maintained by @theHamsta)
|
||||||
|
- [x] [kconfig](https://github.com/amaanq/tree-sitter-kconfig) (maintained by @amaanq)
|
||||||
- [x] [kdl](https://github.com/amaanq/tree-sitter-kdl) (maintained by @amaanq)
|
- [x] [kdl](https://github.com/amaanq/tree-sitter-kdl) (maintained by @amaanq)
|
||||||
- [x] [kotlin](https://github.com/fwcd/tree-sitter-kotlin) (maintained by @SalBakraa)
|
- [x] [kotlin](https://github.com/fwcd/tree-sitter-kotlin) (maintained by @SalBakraa)
|
||||||
- [x] [lalrpop](https://github.com/traxys/tree-sitter-lalrpop) (maintained by @traxys)
|
- [x] [lalrpop](https://github.com/traxys/tree-sitter-lalrpop) (maintained by @traxys)
|
||||||
|
|
|
||||||
|
|
@ -293,6 +293,9 @@
|
||||||
"julia": {
|
"julia": {
|
||||||
"revision": "bb7e587837fdeda74dd510256253d60f59a1e2cd"
|
"revision": "bb7e587837fdeda74dd510256253d60f59a1e2cd"
|
||||||
},
|
},
|
||||||
|
"kconfig": {
|
||||||
|
"revision": "4242bff4d92964a1cbaa95cb45a87a32b3e1c896"
|
||||||
|
},
|
||||||
"kdl": {
|
"kdl": {
|
||||||
"revision": "e180e05132c4cb229a8ba679b298790ef1eca77c"
|
"revision": "e180e05132c4cb229a8ba679b298790ef1eca77c"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -899,6 +899,14 @@ list.julia = {
|
||||||
maintainers = { "@theHamsta" },
|
maintainers = { "@theHamsta" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list.kconfig = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/amaanq/tree-sitter-kconfig",
|
||||||
|
files = { "src/parser.c", "src/scanner.c" },
|
||||||
|
},
|
||||||
|
maintainers = { "@amaanq" },
|
||||||
|
}
|
||||||
|
|
||||||
list.kdl = {
|
list.kdl = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = "https://github.com/amaanq/tree-sitter-kdl",
|
url = "https://github.com/amaanq/tree-sitter-kdl",
|
||||||
|
|
|
||||||
9
queries/kconfig/folds.scm
Normal file
9
queries/kconfig/folds.scm
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
[
|
||||||
|
(config)
|
||||||
|
(menuconfig)
|
||||||
|
(choice)
|
||||||
|
(comment_entry)
|
||||||
|
(menu)
|
||||||
|
(if)
|
||||||
|
(help_text)
|
||||||
|
] @fold
|
||||||
81
queries/kconfig/highlights.scm
Normal file
81
queries/kconfig/highlights.scm
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
"source" @include
|
||||||
|
|
||||||
|
[
|
||||||
|
"mainmenu"
|
||||||
|
"config"
|
||||||
|
"menuconfig"
|
||||||
|
"choice"
|
||||||
|
"endchoice"
|
||||||
|
"comment"
|
||||||
|
"menu"
|
||||||
|
"endmenu"
|
||||||
|
"prompt"
|
||||||
|
"default"
|
||||||
|
"range"
|
||||||
|
"help"
|
||||||
|
(optional)
|
||||||
|
(modules)
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
[
|
||||||
|
"if"
|
||||||
|
"endif"
|
||||||
|
"depends on"
|
||||||
|
"select"
|
||||||
|
"imply"
|
||||||
|
"visible if"
|
||||||
|
] @conditional
|
||||||
|
|
||||||
|
[
|
||||||
|
"def_bool"
|
||||||
|
"def_tristate"
|
||||||
|
] @keyword.function
|
||||||
|
|
||||||
|
[
|
||||||
|
"||"
|
||||||
|
"&&"
|
||||||
|
"="
|
||||||
|
"!="
|
||||||
|
"<"
|
||||||
|
">"
|
||||||
|
"<="
|
||||||
|
">="
|
||||||
|
"!"
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
[
|
||||||
|
"bool"
|
||||||
|
"tristate"
|
||||||
|
"int"
|
||||||
|
"hex"
|
||||||
|
"string"
|
||||||
|
] @type.builtin
|
||||||
|
|
||||||
|
[ "(" ")" ] @punctuation.bracket
|
||||||
|
|
||||||
|
(macro_variable ["$(" ")"] @punctuation.special)
|
||||||
|
|
||||||
|
(symbol) @variable
|
||||||
|
|
||||||
|
[
|
||||||
|
(prompt)
|
||||||
|
(macro_content)
|
||||||
|
(text)
|
||||||
|
] @string
|
||||||
|
|
||||||
|
(config name: (symbol) @constant)
|
||||||
|
(menuconfig name: (symbol) @constant)
|
||||||
|
(choice name: (symbol) @constant)
|
||||||
|
|
||||||
|
((symbol) @constant
|
||||||
|
(#lua-match? @constant "[A-Z0-9]+"))
|
||||||
|
|
||||||
|
(mainmenu name: (prompt) @text.title)
|
||||||
|
(comment_entry name: (prompt) @text.title)
|
||||||
|
(menu name: (prompt) @text.title)
|
||||||
|
|
||||||
|
(source (prompt) @text.uri @string.special)
|
||||||
|
|
||||||
|
(comment) @comment
|
||||||
|
|
||||||
|
(ERROR) @error
|
||||||
11
queries/kconfig/indents.scm
Normal file
11
queries/kconfig/indents.scm
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
(help_text (text) @indent.auto)
|
||||||
|
|
||||||
|
[
|
||||||
|
(config)
|
||||||
|
(menuconfig)
|
||||||
|
(choice)
|
||||||
|
(comment_entry)
|
||||||
|
(menu)
|
||||||
|
(if)
|
||||||
|
(help_text)
|
||||||
|
] @indent.begin
|
||||||
2
queries/kconfig/injections.scm
Normal file
2
queries/kconfig/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment"))
|
||||||
17
queries/kconfig/locals.scm
Normal file
17
queries/kconfig/locals.scm
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
[
|
||||||
|
(symbol)
|
||||||
|
(prompt)
|
||||||
|
] @reference
|
||||||
|
|
||||||
|
[
|
||||||
|
(config)
|
||||||
|
(menuconfig)
|
||||||
|
(choice)
|
||||||
|
(comment_entry)
|
||||||
|
(menu)
|
||||||
|
(if)
|
||||||
|
] @scope
|
||||||
|
|
||||||
|
(type_definition (prompt) @definition.var)
|
||||||
|
(type_definition (input_prompt (prompt) @definition.var))
|
||||||
|
(type_definition_default (expression (prompt) @definition.var))
|
||||||
Loading…
Add table
Add a link
Reference in a new issue