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

Formatting of iterators is wrong #3156

Open
lukaszcz opened this issue Nov 7, 2024 · 0 comments · May be fixed by #3212
Open

Formatting of iterators is wrong #3156

lukaszcz opened this issue Nov 7, 2024 · 0 comments · May be fixed by #3212
Assignees
Milestone

Comments

@lukaszcz
Copy link
Collaborator

lukaszcz commented Nov 7, 2024

The line breaks are inserted at the wrong places. For example,

main : Nat := fst <| for (longlongName1, longlongName2, longlongName3 := 4839248329, 10, 2438729) (x in [1;2;3;4;5;6;7]) {longlongName1 + longlongName2, longlongName1 * longlongName2, x + longlongName3};

is formatted to

main : Nat :=
  fst
    <| for (longlongName1, longlongName2, longlongName3 := 4839248329
      , 10
      , 2438729) (x in [1; 2; 3; 4; 5; 6; 7]) {
      longlongName1 + longlongName2
        , longlongName1 * longlongName2
        , x + longlongName3
    };

If the line needs to be broken, the formatter should break it after the for and then after the initializer. It should try to avoid breaking in the middle of the initializer or the range.

@lukaszcz lukaszcz added this to the 0.6.8 milestone Nov 7, 2024
@paulcadman paulcadman modified the milestones: 0.6.8, 0.6.9 Nov 11, 2024
@lukaszcz lukaszcz self-assigned this Dec 2, 2024
@lukaszcz lukaszcz linked a pull request Dec 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants