nvim-treesitter/queries/gdscript/indents.scm
Ryan Roden-Corrent f67eb83be5 feat(indent): Implement basic indent for gdscript.
Indent is not handled correctly when adding new lines.
It seems that functions/loops/etc. are not recognized until they have at
least one indented block.

For example, if you enter a newline after `func foo():`, the cursor will
not be indented. If you manually indent and add a line like `pass`,
e.g.:

```
func foo():
    pass
```

now any insertions above or below `pass` will be indented correctly.
This might be an issue with the grammar, as it seems to apply to highlights
as well.

The following will not be highligted

```
func foo():
```

However, the following will be:

```
func foo():
    pass
```
2022-01-24 13:11:01 +01:00

24 lines
325 B
Scheme

[
(if_statement)
(for_statement)
(while_statement)
(parenthesized_expression)
(function_definition)
(class_definition)
] @indent
((argument_list) @aligned_indent
(#set! "delimiter" "()"))
((parameters) @aligned_indent
(#set! "delimiter" "()"))
[
")"
"]"
"}"
(elif_clause)
(else_clause)
] @branch