Closed hochata closed 1 year ago
thanks for logging this @hochata. i will have a look at this later today.
@hochata This issue should be fixed for most of the scenarios. I had to regress on other indentation issues, but think they were more of an edge case and this is more important. Please let me know if the latest change fixes your issue.
Hi, sorry for the late response.
It is still present on the main branch, and I also noticed it happens with parenthesis.
For example, a function call with no arguments gets indented like this
func(
|
)
But if you start typing some arguments it gets correctly fixed
func(
arg|
)
But I think it is a pretty minor bug. It doesn't affect usability that much, it is just annoying.
@hochata i will continue to tweak, but there are some limitations from the elixir tree sitter grammar where we don't always know the parent of the function, so it looks at the source node ( main node ).
It is strange that you still get it for tuples though. Will have a further look.
Lets leave this open.
My bad @wkirschbaum , I think I was running an older versions without noticing it.
As you pointed out, this is solved for tuples in main!
Should I keep this open for the function calls case? Or maybe tag it as treesit-grammar-limitation
and close it?
Thinking about it, even if an issue regarding the tree-sitter grammar limitation stays open, it should be a new dedicated issue.
Thanks for solving this!
When typing a tuple in multiples lines, the indentation initially looks like this
But if you start typing anything, it gets properly indented
For contrast, inside both list and maps you get the second example indentation without the need to type anything.