Formatting Issues with 'when' Clauses in Elixir

76
clicks
Formatting Issues with 'when' Clauses in Elixir

Source: reddit.com

Type: Discussion

Kev-wqa encountered an issue with the Elixir code formatter where 'when' clauses within a function are being indented further than expected. This causes the 'when' line to be misaligned compared to other lines of code, leading to questions about possible configurations for the formatter. Forum member tzigane suggests modifying `.formatter.exs` to increase the `line_length` option, which might prevent undesired line breaks that lead to odd indentation. Kev-wqa acknowledges the suggestion but notes that the issue persists when manually breaking lines.

© HashMerge 2024