Commit 4f71041
Fix elseif / else indentation and support incomplete structures (#42)
Closes #36: `elseif` /
`else` statements are now correctly outdented, with the following line
now also indented as expected.
This PR leverages the `indent_pattern` configuration available to
language extensions, similar to other extensions (Ruby, Python, Julia,
Elixir) that work around tree-sitter indentation limitations.
Additionally, it provides fallback indentation for control structures
and function definitions when the syntax tree is temporarily incomplete
(e.g. an `if` statement without its closing `end`), which is especially
useful when not using code snippets. These cases cannot yet be handled
by tree-sitter alone. See the [Julia
extension](https://github.com/JuliaEditorSupport/zed-julia/blob/main/languages/julia/config.toml)
for related rationale.
Co-authored-by: Finn Evers <finn@zed.dev>1 parent 953af8c commit 4f71041
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments