Skip to content

Fix elseif / else indentation and support incomplete structures#42

Open
Fringale wants to merge 1 commit intozed-extensions:mainfrom
Fringale:Fringale-indent-patterns
Open

Fix elseif / else indentation and support incomplete structures#42
Fringale wants to merge 1 commit intozed-extensions:mainfrom
Fringale:Fringale-indent-patterns

Conversation

@Fringale
Copy link

@Fringale Fringale commented Mar 1, 2026

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 for related rationale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lua indentation is broken

1 participant