You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to work around this issue that when writing anonymous functions, treesitter-based indentation (in Neovim) always trips up if there are no clauses:
enum=[1,2,3]Enum.map(enum,fn# Typing <CR> here takes the cursor to the left margin.|end)
Re-applying indentation to these lines causes them all to jump to the left margin.
The issue seems to be that there's an ERROR node there, because an fn end without clauses is not well-formed Elixir. But it would be really handy if the treesitter grammar could accept this as an anonymous function, because it's certainly a common enough shape for the code to be in before clauses are added. My hope is that if the grammar can accept this as an anonymous function, indentation will follow suit.
The text was updated successfully, but these errors were encountered:
I've been trying to work around this issue that when writing anonymous functions, treesitter-based indentation (in Neovim) always trips up if there are no clauses:
Re-applying indentation to these lines causes them all to jump to the left margin.
The issue seems to be that there's an
ERROR
node there, because anfn end
without clauses is not well-formed Elixir. But it would be really handy if the treesitter grammar could accept this as an anonymous function, because it's certainly a common enough shape for the code to be in before clauses are added. My hope is that if the grammar can accept this as an anonymous function, indentation will follow suit.The text was updated successfully, but these errors were encountered: