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
The setting KeepNewlineAfter is in some shape or form the successor of PreserveEndOfLine although in a limited set of cases.
This setting would register a newline after = in the original source code (via Trivia parsing) and preserve that newline.
For example:
leta=42
With KeepNewlineAfter the code remains unchanged after formatting.
Problem statement
This main issue with this setting is that it shouldn't preserve stylistic choice from the source code as these are purely driven by the user. It is the user responsibility to write consistent code and that beats the purpose of a code formatter.
Alternative
As #721 is progressing it allows for more freedom in configuring the output of the formatted code.
The user can limit the length of certain code constructs via settings.
These setting will enforce a consistent codebase and partially remove the need for having KeepNewlineAfter setting.
In the example above, the MaxLetBindingWidth setting could be set to 0 and lead to the same result.
Description
The setting
KeepNewlineAfter
is in some shape or form the successor ofPreserveEndOfLine
although in a limited set of cases.This setting would register a newline after
=
in the original source code (via Trivia parsing) and preserve that newline.For example:
With
KeepNewlineAfter
the code remains unchanged after formatting.Problem statement
This main issue with this setting is that it shouldn't preserve stylistic choice from the source code as these are purely driven by the user. It is the user responsibility to write consistent code and that beats the purpose of a code formatter.
Alternative
As #721 is progressing it allows for more freedom in configuring the output of the formatted code.
The user can limit the length of certain code constructs via settings.
These setting will enforce a consistent codebase and partially remove the need for having
KeepNewlineAfter
setting.In the example above, the
MaxLetBindingWidth
setting could be set to0
and lead to the same result.//cc @jindraivanek
The text was updated successfully, but these errors were encountered: