Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sunset setting KeepNewlineAfter #737

Closed
nojaf opened this issue Mar 29, 2020 · 1 comment
Closed

Sunset setting KeepNewlineAfter #737

nojaf opened this issue Mar 29, 2020 · 1 comment
Labels

Comments

@nojaf
Copy link
Contributor

nojaf commented Mar 29, 2020

Description

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:

let a = 
    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.

//cc @jindraivanek

@nojaf nojaf added the v4 label Mar 29, 2020
@nojaf nojaf mentioned this issue Mar 29, 2020
7 tasks
@nojaf
Copy link
Contributor Author

nojaf commented Apr 19, 2020

The setting was removed in #721

@nojaf nojaf closed this as completed Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant