Add textobject for gdscript (#3760)
commita15420ed1c3b46df0dade6ec6d05a0e4b26e06e0
authorErasin <erasinoo@gmail.com>
dateSat 10 Sep 2022, 21:47 (4 years ago)
parent54e78dd
book/src/generated/lang-support.md+1−1
@@ -29,7 +29,7 @@
2929| esdl | ✓ | | | |
3030| fish | ✓ | ✓ | ✓ | |
3131| fortran | ✓ | | ✓ | `fortls` |
32−| gdscript | ✓ | | | |
32+| gdscript | ✓ | ✓ | | |
3333| git-attributes | ✓ | | | |
3434| git-commit | ✓ | | | |
3535| git-config | ✓ | | | |
languages.toml+1−1
@@ -1327,7 +1327,7 @@ shebangs = []
13271327roots = ["project.godot"]
13281328auto-format = true
13291329comment-token = "#"
1330−indent = { tab-width = 4, unit = " " }
1330+indent = { tab-width = 4, unit = "\t" }
13311331
13321332[[grammar]]
13331333name = "gdscript"
runtime/queries/gdscript/highlights.scm+5
@@ -3,6 +3,11 @@
33((identifier) @constant
44 (#match? @constant "^[A-Z][A-Z_]*$"))
55
6+; class
7+(class_name_statement (name) @type)
8+(class_definition (name) @type)
9+
10+
611; Function calls
712
813(attribute_call (identifier) @function)
runtime/queries/gdscript/textobjects.scmnew file+17
@@ -0,0 +1,17 @@
1+
2+(class_definition
3+ (body) @class.inside) @class.around
4+
5+(function_definition
6+ (body) @function.inside) @function.around
7+
8+(parameters
9+ [
10+ (identifier)
11+ (typed_parameter)
12+ (default_parameter)
13+ (typed_default_parameter)
14+ ] @parameter.inside @parameter.around)
15+
16+(comment) @comment.inside
17+(comment)+ @comment.around