summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--book/src/generated/lang-support.md2
-rw-r--r--languages.toml2
-rw-r--r--runtime/queries/gdscript/highlights.scm5
-rw-r--r--runtime/queries/gdscript/textobjects.scm17
4 files changed, 24 insertions, 2 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index 70609464..37ceec16 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -29,7 +29,7 @@
| esdl | ✓ | | | |
| fish | ✓ | ✓ | ✓ | |
| fortran | ✓ | | ✓ | `fortls` |
-| gdscript | ✓ | | | |
+| gdscript | ✓ | ✓ | | |
| git-attributes | ✓ | | | |
| git-commit | ✓ | | | |
| git-config | ✓ | | | |
diff --git a/languages.toml b/languages.toml
index 1a3be93c..83e4affd 100644
--- a/languages.toml
+++ b/languages.toml
@@ -1327,7 +1327,7 @@ shebangs = []
roots = ["project.godot"]
auto-format = true
comment-token = "#"
-indent = { tab-width = 4, unit = " " }
+indent = { tab-width = 4, unit = "\t" }
[[grammar]]
name = "gdscript"
diff --git a/runtime/queries/gdscript/highlights.scm b/runtime/queries/gdscript/highlights.scm
index 0849eedb..f36f4e35 100644
--- a/runtime/queries/gdscript/highlights.scm
+++ b/runtime/queries/gdscript/highlights.scm
@@ -3,6 +3,11 @@
((identifier) @constant
(#match? @constant "^[A-Z][A-Z_]*$"))
+; class
+(class_name_statement (name) @type)
+(class_definition (name) @type)
+
+
; Function calls
(attribute_call (identifier) @function)
diff --git a/runtime/queries/gdscript/textobjects.scm b/runtime/queries/gdscript/textobjects.scm
new file mode 100644
index 00000000..08954468
--- /dev/null
+++ b/runtime/queries/gdscript/textobjects.scm
@@ -0,0 +1,17 @@
+
+(class_definition
+ (body) @class.inside) @class.around
+
+(function_definition
+ (body) @function.inside) @function.around
+
+(parameters
+ [
+ (identifier)
+ (typed_parameter)
+ (default_parameter)
+ (typed_default_parameter)
+ ] @parameter.inside @parameter.around)
+
+(comment) @comment.inside
+(comment)+ @comment.around