From a15420ed1c3b46df0dade6ec6d05a0e4b26e06e0 Mon Sep 17 00:00:00 2001 From: Erasin Date: Sat, 10 Sep 2022 21:47:08 +0800 Subject: Add textobject for gdscript (#3760) --- runtime/queries/gdscript/highlights.scm | 5 +++++ runtime/queries/gdscript/textobjects.scm | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 runtime/queries/gdscript/textobjects.scm (limited to 'runtime/queries/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 -- cgit v1.2.3-70-g09d2