on master help sign in
gdscript support (#1985)
50df924EmmChriss
book/src/generated/lang-support.md+1
@@ -16,6 +16,7 @@
16| erb | ✓ | | | |
16| erb | ✓ | | | |
17| erlang | ✓ | | | `erlang_ls` |
17| erlang | ✓ | | | `erlang_ls` |
18| fish | ✓ | ✓ | ✓ | |
18| fish | ✓ | ✓ | ✓ | |
19+| gdscript | ✓ | | ✓ | |
19| git-commit | ✓ | | | |
20| git-commit | ✓ | | | |
20| git-config | ✓ | | | |
21| git-config | ✓ | | | |
21| git-diff | ✓ | | | |
22| git-diff | ✓ | | | |
languages.toml+15
@@ -1150,3 +1150,18 @@ injection-regex = "sql"
1150[[grammar]]
1150[[grammar]]
1151name = "sql"
1151name = "sql"
1152source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "0caa7fa2ee00e0b770493a79d4efacc1fc376cc5" }
1152source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "0caa7fa2ee00e0b770493a79d4efacc1fc376cc5" }
1153+
1154+[[language]]
1155+name = "gdscript"
1156+scope = "source.gdscript"
1157+injection-regex = "gdscript"
1158+file-types = ["gd"]
1159+shebangs = []
1160+roots = ["project.godot"]
1161+auto-format = true
1162+comment-token = "#"
1163+indent = { tab-width = 4, unit = " " }
1164+
1165+[[grammar]]
1166+name = "gdscript"
1167+source = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript", rev = "2a6abdaa47fcb91397e09a97c7433fd995ea46c6" }
runtime/queries/gdscript/highlights.scmnew file+93
@@ -0,0 +1,93 @@
1+; Identifier naming conventions
2+
3+((identifier) @constant
4+ (#match? @constant "^[A-Z][A-Z_]*$"))
5+
6+; Function calls
7+
8+(attribute_call (identifier) @function)
9+
10+(base_call (identifier) @function)
11+
12+(call (identifier) @function)
13+
14+; Function definitions
15+
16+(function_definition (name) @function)
17+
18+(constructor_definition "_init" @function)
19+
20+;; Literals
21+(integer) @constant.numeric.integer
22+(float) @constant.numeric.float
23+(comment) @comment
24+(string) @string
25+(escape_sequence) @constant.character.escape
26+(identifier) @variable
27+(type) @type
28+
29+;; Literals
30+[
31+ (true)
32+ (false)
33+ (null)
34+] @constant.builtin
35+
36+[
37+ "+"
38+ "-"
39+ "*"
40+ "/"
41+ "%"
42+ "=="
43+ "!="
44+ ">"
45+ "<"
46+ ">="
47+ "<="
48+ "="
49+ "+="
50+ "-="
51+ "*="
52+ "/="
53+ "%="
54+ "&"
55+ "|"
56+ "^"
57+ "~"
58+ "<<"
59+ ">>"
60+ "and"
61+ "or"
62+ "not"
63+] @operator
64+
65+[
66+ (static_keyword)
67+ (remote_keyword)
68+ (tool_statement)
69+ "var"
70+ "func"
71+ "setget"
72+ "in"
73+ "is"
74+ "as"
75+ "if"
76+ "else"
77+ "elif"
78+ "while"
79+ "for"
80+ "return"
81+ "break"
82+ "continue"
83+ "pass"
84+ "match"
85+ "class"
86+ "class_name"
87+ "enum"
88+ "signal"
89+ "onready"
90+ "export"
91+ "extends"
92+ "const"
93+] @keyword
runtime/queries/gdscript/indents.scmnew file+26
@@ -0,0 +1,26 @@
1+[
2+ (_compound_statement)
3+ (match_statement)
4+ (parenthesized_expression)
5+
6+ (pattern_array)
7+ (pattern_dictionary)
8+ (argument_list)
9+ (binary_operator)
10+
11+ (parameters)
12+ (body)
13+ (enumerator_list)
14+
15+ (function_definition)
16+ (constructor_definition)
17+ (class_definition)
18+] @indent
19+
20+[
21+ ")",
22+ "]",
23+ "}",
24+ (return_statement)
25+ (pass_statement)
26+] @outdent
runtime/queries/gdscript/tags.scmnew file+5
@@ -0,0 +1,5 @@
1+(class_definition (name) @name) @definition.class
2+
3+(function_definition (name) @name) @definition.function
4+
5+(call (name) @name) @reference.call