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
You can set indentations_before to a non-zero value despite newlines_before being zero.
There's no good reason to want indentations before a token without any line breaks preceding them. It's not even useful for alignment, because you would want to use spaces for that.
The same is true of continuations.
It should be possible to leverage the type system to enforce that every indentation or continuation is preceded by a line break. In particular the NonZero* types in std::num would be useful.
The text was updated successfully, but these errors were encountered:
zaneduffield
changed the title
Enforce idents/continuations must follow a line break
Enforce indents/continuations must follow a line break
Apr 11, 2024
Currently, it's possible get
FormattingData
into a semi-invalid state pretty easily.pasfmt/core/src/lang.rs
Lines 373 to 379 in bd8e1e8
You can set
indentations_before
to a non-zero value despitenewlines_before
being zero.There's no good reason to want indentations before a token without any line breaks preceding them. It's not even useful for alignment, because you would want to use spaces for that.
The same is true of continuations.
It should be possible to leverage the type system to enforce that every indentation or continuation is preceded by a line break. In particular the
NonZero*
types in std::num would be useful.The text was updated successfully, but these errors were encountered: