mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-21 04:40:08 -04:00
feat: add GN (Generate Ninja)
This commit is contained in:
parent
2f15204510
commit
6cb93819c9
8 changed files with 113 additions and 0 deletions
|
|
@ -240,6 +240,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
||||||
- [x] [gleam](https://github.com/gleam-lang/tree-sitter-gleam) (maintained by @amaanq)
|
- [x] [gleam](https://github.com/gleam-lang/tree-sitter-gleam) (maintained by @amaanq)
|
||||||
- [x] [Glimmer and Ember](https://github.com/alexlafroscia/tree-sitter-glimmer) (maintained by @NullVoxPopuli)
|
- [x] [Glimmer and Ember](https://github.com/alexlafroscia/tree-sitter-glimmer) (maintained by @NullVoxPopuli)
|
||||||
- [x] [glsl](https://github.com/theHamsta/tree-sitter-glsl) (maintained by @theHamsta)
|
- [x] [glsl](https://github.com/theHamsta/tree-sitter-glsl) (maintained by @theHamsta)
|
||||||
|
- [x] [GN (Generate Ninja)](https://github.com/amaanq/tree-sitter-gn) (maintained by @amaanq)
|
||||||
- [x] [go](https://github.com/tree-sitter/tree-sitter-go) (maintained by @theHamsta, @WinWisely268)
|
- [x] [go](https://github.com/tree-sitter/tree-sitter-go) (maintained by @theHamsta, @WinWisely268)
|
||||||
- [x] [Godot Resources (gdresource)](https://github.com/PrestonKnopp/tree-sitter-godot-resource) (maintained by @pierpo)
|
- [x] [Godot Resources (gdresource)](https://github.com/PrestonKnopp/tree-sitter-godot-resource) (maintained by @pierpo)
|
||||||
- [x] [gomod](https://github.com/camdencheek/tree-sitter-go-mod) (maintained by @camdencheek)
|
- [x] [gomod](https://github.com/camdencheek/tree-sitter-go-mod) (maintained by @camdencheek)
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,9 @@
|
||||||
"glsl": {
|
"glsl": {
|
||||||
"revision": "952739a25a7c014882aa777f1a32da8950f31f58"
|
"revision": "952739a25a7c014882aa777f1a32da8950f31f58"
|
||||||
},
|
},
|
||||||
|
"gn": {
|
||||||
|
"revision": "492878ebee3552ac4631b064e02d19a00b894535"
|
||||||
|
},
|
||||||
"go": {
|
"go": {
|
||||||
"revision": "bbaa67a180cfe0c943e50c55130918be8efb20bd"
|
"revision": "bbaa67a180cfe0c943e50c55130918be8efb20bd"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -641,6 +641,15 @@ list.glsl = {
|
||||||
maintainers = { "@theHamsta" },
|
maintainers = { "@theHamsta" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list.gn = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/amaanq/tree-sitter-gn",
|
||||||
|
files = { "src/parser.c", "src/scanner.c" },
|
||||||
|
},
|
||||||
|
maintainers = { "@amaanq" },
|
||||||
|
readme_name = "GN (Generate Ninja)",
|
||||||
|
}
|
||||||
|
|
||||||
list.go = {
|
list.go = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = "https://github.com/tree-sitter/tree-sitter-go",
|
url = "https://github.com/tree-sitter/tree-sitter-go",
|
||||||
|
|
|
||||||
6
queries/gn/folds.scm
Normal file
6
queries/gn/folds.scm
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
[
|
||||||
|
(list)
|
||||||
|
(block)
|
||||||
|
(if_statement)
|
||||||
|
(else_statement)
|
||||||
|
] @fold
|
||||||
74
queries/gn/highlights.scm
Normal file
74
queries/gn/highlights.scm
Normal file
|
|
@ -0,0 +1,74 @@
|
||||||
|
; Includes
|
||||||
|
|
||||||
|
"import" @include
|
||||||
|
|
||||||
|
; Conditionals
|
||||||
|
|
||||||
|
[
|
||||||
|
"if"
|
||||||
|
"else"
|
||||||
|
] @conditional
|
||||||
|
|
||||||
|
; Repeats
|
||||||
|
|
||||||
|
"foreach" @repeat
|
||||||
|
|
||||||
|
; Operators
|
||||||
|
|
||||||
|
[
|
||||||
|
"="
|
||||||
|
"+="
|
||||||
|
"-="
|
||||||
|
"!"
|
||||||
|
"+"
|
||||||
|
"-"
|
||||||
|
"<"
|
||||||
|
"<="
|
||||||
|
">"
|
||||||
|
">="
|
||||||
|
"=="
|
||||||
|
"!="
|
||||||
|
"&&"
|
||||||
|
"||"
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
; Variables
|
||||||
|
|
||||||
|
(identifier) @variable
|
||||||
|
|
||||||
|
; Functions
|
||||||
|
|
||||||
|
(call_expression function: (identifier) @function.call)
|
||||||
|
|
||||||
|
; Fields
|
||||||
|
|
||||||
|
(scope_access field: (identifier) @field)
|
||||||
|
|
||||||
|
; Literals
|
||||||
|
|
||||||
|
(string) @string
|
||||||
|
|
||||||
|
(escape_sequence) @string.escape
|
||||||
|
|
||||||
|
(expansion) @none
|
||||||
|
|
||||||
|
(integer) @number
|
||||||
|
|
||||||
|
(hex) @string.special
|
||||||
|
|
||||||
|
(boolean) @boolean
|
||||||
|
|
||||||
|
; Punctuation
|
||||||
|
|
||||||
|
[ "{" "}" "[" "]" "(" ")" ] @punctuation.bracket
|
||||||
|
|
||||||
|
[
|
||||||
|
"."
|
||||||
|
","
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
(expansion ["$" "${" "}"] @punctuation.special)
|
||||||
|
|
||||||
|
; Comments
|
||||||
|
|
||||||
|
(comment) @comment
|
||||||
12
queries/gn/indents.scm
Normal file
12
queries/gn/indents.scm
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
(block)
|
||||||
|
(parenthesized_expression)
|
||||||
|
] @indent.begin
|
||||||
|
|
||||||
|
[
|
||||||
|
"}"
|
||||||
|
")"
|
||||||
|
"]"
|
||||||
|
] @indent.end @indent.branch
|
||||||
|
|
||||||
|
(comment) @indent.auto
|
||||||
2
queries/gn/injections.scm
Normal file
2
queries/gn/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment"))
|
||||||
6
queries/gn/locals.scm
Normal file
6
queries/gn/locals.scm
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
[
|
||||||
|
(source_file)
|
||||||
|
(block)
|
||||||
|
] @scope
|
||||||
|
|
||||||
|
(identifier) @reference
|
||||||
Loading…
Add table
Add a link
Reference in a new issue