Skip to content

"Line" used confusingly in rules for formatting let statements. #164

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

Closed
Chronos-Sk opened this issue May 21, 2021 · 2 comments
Closed

"Line" used confusingly in rules for formatting let statements. #164

Chronos-Sk opened this issue May 21, 2021 · 2 comments

Comments

@Chronos-Sk
Copy link

The formatting rules for let statements uses inconsistent meaning for the word "line", to the point where I get lost trying to understand what some of the rules even mean:

If the first line does not fit on a single line, then split after the colon,
using block indentation. If the type covers multiple lines, even after line-
breaking after the :, then the first line may be placed on the same line as
the :, subject to the combining rules (WIP).

Statements.md

There should probably be distinct terminology for a logical line and a formatted line. Or, at least, there should be more disambiguation.

@calebcartwright
Copy link
Member

calebcartwright commented Jun 23, 2021

Thanks for sharing. Would you mind expanding on your description to help me better understand your perspective? For example, you've introduced phrases like "logical line" that aren't part of the Style Guide, and it's not clear to me what that phrase means to you. Additionally, I'm unclear what aspect(s) of the formatting rules for the statement you've linked to you find confusing.

Remember that there is a contiguous, sequential theme to many of the codified rules that just happen to have code snippets with the rule description to provide a visual representation as the parts of the rule are provided.

Specifically with the text you've quoted (if the first line does not fit on a single line) this is a continuation of the immediately preceding text describing a scenario where the entire statement cannot fit on one line, and so would be split after the assignment operator, e.g.

let pattern: Type =
    expr;

but it goes a step further to describe what to do next after applying that split in case the remaining first line (let pattern: Type =) itself still cannot fit on one line, namely moving the type portion around.

@calebcartwright
Copy link
Member

Feel free to add a follow up comment, but I think given the above it makes sense to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants