tree-sitter-c3
tree-sitter-c3 copied to clipboard
Indentation support
I've been playing a bit with indentation queries for neovim, I've landed on this so far:
[
(compound_stmt)
(while_stmt)
(enum_body)
(switch_body)
(initializer_list)
(struct_body)
(case_stmt)
(default_stmt)
(call_invocation)
] @indent.begin
[
")"
"}"
] @indent.branch @indent.end
[
(block_comment)
(doc_comment)
] @indent.auto
And it seems to work fine, posting this here mainly for people to find/try/give feedback, I'll PR it after some time of usage, if it doesn't break too much.
Using this worked for me when I removed (expr_block). But if (...) {} else {} seems broken (it is indenting twice in the else block)
I finally added an indents.scm with some additions, please give it a try.
I've tried it, reindented a couple of files and seems fine from a quick glance. I'll see if I run into any issues while editting.