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

Add EntityListAlign to imports step #469

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sorki
Copy link

@sorki sorki commented Nov 7, 2023

This patch add support for alignment of lists of constructors, class methods, fields names in import lists entities.

ELMultiline causes

import Foo (Bar(x, y))

To be expanded to

import Foo
  (Bar
    ( x
    , y
    )
  )

This is useful in combination with LongListAlign Multiline to get a git friendly formatting.

This patch add support for alignment of lists of constructors,
class methods, fields names in import lists entities.

`ELMultiline` causes

```
import Foo (Bar(x, y))
```

To be expanded to

```
import Foo
  (Bar
    ( x
    , y
    )
  )
```

This is useful in combination with `LongListAlign` `Multiline`
to get a git friendly formatting.
@sorki
Copy link
Author

sorki commented Nov 7, 2023

A less contrived (and prettier) test requires #468 for forcing multiline only output, which causes the output to look like:

import Linear
  ( V2(V2)
  , V3(V3)
  , V4(V4)
  )

import Prelude
  ( Bool(True)
  , Eq((==))
  , Num 
      ( (*) 
      , (+) 
      )   
  )

The special case of single entity is needed to prevent

import Linear
  ( V2
      ( V2
      )
  , V3
      ( V3
      )
  , V4
      ( V4
      )
  )

This in combination with #468 allows for the most git-friendly formatting when explicit import lists are used (typically when -Wmissing-import-lists is enabled).

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

Successfully merging this pull request may close these issues.

1 participant