mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
Add textobject for gdscript (#3760)
This commit is contained in:
parent
54e78dd24f
commit
a15420ed1c
@ -29,7 +29,7 @@
|
|||||||
| esdl | ✓ | | | |
|
| esdl | ✓ | | | |
|
||||||
| fish | ✓ | ✓ | ✓ | |
|
| fish | ✓ | ✓ | ✓ | |
|
||||||
| fortran | ✓ | | ✓ | `fortls` |
|
| fortran | ✓ | | ✓ | `fortls` |
|
||||||
| gdscript | ✓ | | | |
|
| gdscript | ✓ | ✓ | | |
|
||||||
| git-attributes | ✓ | | | |
|
| git-attributes | ✓ | | | |
|
||||||
| git-commit | ✓ | | | |
|
| git-commit | ✓ | | | |
|
||||||
| git-config | ✓ | | | |
|
| git-config | ✓ | | | |
|
||||||
|
@ -1327,7 +1327,7 @@ shebangs = []
|
|||||||
roots = ["project.godot"]
|
roots = ["project.godot"]
|
||||||
auto-format = true
|
auto-format = true
|
||||||
comment-token = "#"
|
comment-token = "#"
|
||||||
indent = { tab-width = 4, unit = " " }
|
indent = { tab-width = 4, unit = "\t" }
|
||||||
|
|
||||||
[[grammar]]
|
[[grammar]]
|
||||||
name = "gdscript"
|
name = "gdscript"
|
||||||
|
@ -3,6 +3,11 @@
|
|||||||
((identifier) @constant
|
((identifier) @constant
|
||||||
(#match? @constant "^[A-Z][A-Z_]*$"))
|
(#match? @constant "^[A-Z][A-Z_]*$"))
|
||||||
|
|
||||||
|
; class
|
||||||
|
(class_name_statement (name) @type)
|
||||||
|
(class_definition (name) @type)
|
||||||
|
|
||||||
|
|
||||||
; Function calls
|
; Function calls
|
||||||
|
|
||||||
(attribute_call (identifier) @function)
|
(attribute_call (identifier) @function)
|
||||||
|
17
runtime/queries/gdscript/textobjects.scm
Normal file
17
runtime/queries/gdscript/textobjects.scm
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user