1
1
mirror of https://github.com/google/ormolu.git synced 2024-11-30 14:46:39 +03:00
Commit Graph

12 Commits

Author SHA1 Message Date
Utku Demir
af907ecb9e Make the first newline optional on class declarations 2019-08-26 10:49:23 +02:00
Utku Demir
9a1f5ebd87 Split large examples
There has been a lot of good intense work lately and as a result of that
some examples have grown considerably. The problem is that we do not show
diffs when something is not formatted as expected, we show entire
"expected/got" files. It works well when files are small, but not so well
where they are huge (some of our examples are well beyond 100 lines). It can
be hard to understand where the problem is.

This commit split long examples into smaller ones to make it easier to see
what went wrong when a test fails.
2019-08-25 12:35:31 +02:00
Utku Demir
159e5e7761 Use new operator style in types & declarations
```
a
  + b
```

instead of

```
a +
  b
2019-08-16 16:15:28 +02:00
Utku Demir
16f2c644a7 Implement handling of semicolons 2019-08-16 15:41:40 +02:00
mrkkrp
e344f61d33 Fix some inconsistency in indentation 2019-08-04 16:50:38 +02:00
mrkkrp
85d5f78b4b Change parens style and how separated lists of items are printed
Goals:

* Make the set of combinators clearer and smaller.
* Solve a number of issues, such as those about parse failures related to
  patterns.
* Solve the bug from #244.

The idea is very simple, we stop doing this

  ( foo
  , bar
  )

and start doing this

( foo,
  bar
  )

* We switch to trailing commas which solves the indentation issues for
  patterns automatically.
* The new general ‘sep’ combinator finally is clear enough, and all the old
  zoo of ‘velt’ and ‘velt'’ and ‘sepWith’, etc. which was confusing and
  overlapping goes away.
2019-08-04 13:32:06 +02:00
waddlaw
ae40a33507 Sort language pragmas and fix their placement in modules
The approach we take here is parsing of language pragmas on creation of
comment stream and then pretty-printing them in a separate block.
2019-07-05 20:03:31 +02:00
yumiova
ba64967c03 Implement properly indented constraint contexts
Essentially, it simply indents the constraints one layer, instead of hanging the constraints off of `class` or `instance`.
2019-06-28 21:09:15 +02:00
yumiova
bdc8738fa8 Add newlines between most declarations in a type class
Certain other kinds of declarations (such as associated type signatures and
bindings) are grouped together without newlines. The process for determining
which declarations are grouped reuses the same logic as for modules.
2019-06-25 23:26:43 +02:00
Rupert Horlick
4a0e5d4e42 [#94] Improve handling of newline before match group bodies
The PR changes the body layouting to use a span that includes the last point in
the name/pattern part of a match. This forces the layout to be multiline iff the
body starts on a newline.
2019-06-19 21:38:53 +02:00
yumiova
515251c7a5 Support infix operator & multi-line class names 2019-06-19 21:09:34 +02:00
yumiova
7e31ae7407 Implement rendering of type class declarations 2019-06-16 13:59:10 +02:00