feat: gdscript support

This commit is contained in:
mathrim 2024-03-20 23:22:57 +01:00 committed by Lewis Russell
parent 2484f58384
commit ce37c77155
3 changed files with 144 additions and 0 deletions

View file

@ -33,6 +33,7 @@ Note: if you need support for Neovim 0.6.x please use the tag `compat/0.6`.
- [x] `fennel`
- [x] `fish`
- [x] `fortran`
- [x] `gdscript`
- [x] `glimmer`
- [x] `go`
- [x] `graphql`

View file

@ -0,0 +1,40 @@
(function_definition
body: (_) @context.end
) @context
(if_statement
body: (_) @context.end
) @context
(elif_clause
body: (_) @context.end
) @context
(else_clause
body: (_) @context.end
) @context
(for_statement
body: (_) @context.end
) @context
(while_statement
body: (_) @context.end
) @context
(class_definition
body: (_) @context.end
) @context
(match_statement
body: (_) @context.end
) @context
(pattern_section
body: (_) @context.end
) @context
(enum_definition
body: (_) @context.end
) @context

103
test/test.gd Normal file
View file

@ -0,0 +1,103 @@
enum Test {
VALUE1,
VALUE2,
VALUE3,
}
func test_function():
var test_value = Test.Value1
if test_value = Test.VALUE1:
# do nothing
pass
elif test_value = Test.VALUE2:
for i in 5:
# do nothing 5 times
pass
else:
while true:
# do nothing forever
pass
match test_value:
Test.VALUE1:
print("foo")
Test.VALUE2:
print("bar")
class HelpClass:
var class_variable
func class_function():
print("foobar")