Commit Graph

437 Commits

Author SHA1 Message Date
Mark Karpov
e29dd2b1c7 Fix the bug when comments in different styles get glued together 2020-06-24 17:10:54 +02:00
Mark Karpov
c97ba55762
Change comment style in the readme
[skip ci]
2020-06-23 11:56:43 +02:00
Mark Karpov
5043f16341
Version bump (0.1.1.0) 2020-06-23 11:42:57 +02:00
Mark Karpov
ca83f15869 Implement merging on imports 2020-06-22 16:31:26 +02:00
Mark Karpov
03e6c70a78
Mention ‘stack install’ in the readme 2020-06-21 14:54:59 +02:00
Mark Karpov
c261356bc4
Recommend lts-16.0 in the readme 2020-06-21 10:45:18 +02:00
Mark Karpov
be1eac66c3 Implement merging of the items in import sections 2020-06-19 17:39:23 +02:00
Mark Karpov
e09fcc0316 Fix the bug related to de-association of pragma comments 2020-06-18 13:59:04 +02:00
Mark Karpov
3fc444a70b Fixed the bug in the de-duplicating algorithm for import lists 2020-06-17 16:50:32 +02:00
Mark Karpov
35f4fb3932 Deal with non-zero indentation in region formatting
Improved region formatting so that indented fragments can also be processed
correctly.
2020-06-16 14:20:52 +02:00
Luke Worth
c982ba9284
Fix build errors with nix on macOS 2020-06-15 23:38:59 +02:00
Mark Karpov
cc337bda18 Prevent type applications from gluing to TH splices that follow them 2020-06-15 12:12:23 +02:00
Mark Karpov
a877785709 Preserve blank lines in ‘let’ and ‘where’ bindings 2020-06-15 10:56:03 +02:00
Mark Karpov
033bb16032
Refactor printing of tuples and tuple sections 2020-06-12 11:45:17 +02:00
Mark Karpov
d5a5bf66c0 Fix rendering of function arguments in multiline layout 2020-06-10 15:14:46 +02:00
Mark Karpov
2efc5d37f9 Format linked lists with colon as line terminator
This adds support for a formatting style described here:

<https://wiki.haskell.org/List_notation>
2020-06-10 14:31:07 +02:00
Mark Karpov
6dfd6f088e Introduce the ‘inciIf’ combinator 2020-06-08 12:01:22 +02:00
Mark Karpov
903d8d9eef Avoid outputting trailing whitespace in multiline comments 2020-06-04 16:50:47 +02:00
Mark Karpov
2b1d013d7c Put operators after other names
Previously ‘RdrName’s were sorted by simple comparison of their names.
However, in ASCII not all “operator-like” symbols go after alpha-numeric
characters. This resulted in this sort of output:

  import Linear.Vector ((*^), Additive (..), (^*))

The new ordering scheme allows us to separate operators and other names:

  import Linear.Vector (Additive (..), (*^), (^*))
2020-06-03 17:39:12 +02:00
Mark Karpov
67e43e0057 Handle magic comments for disabling/enabling with more flexibility 2020-06-03 15:28:57 +02:00
Mark Karpov
2f53306ff7
Move around ‘space’ in ‘p_conDecl’ 2020-06-02 10:51:06 +02:00
Mark Karpov
c895ef49be
Misc refactoring around "::" symbols 2020-06-01 14:42:17 +02:00
Mark Karpov
a99cff03cf
Use ‘inci’ instead of ‘sitcc’ in ‘p_classFundeps’ 2020-05-28 09:36:20 +02:00
Mark Karpov
20a06bf4db
Add documentation for ‘interferingTxt’ 2020-05-28 09:23:41 +02:00
Mark Karpov
d24c11b796
Use ‘commaDel’ in ‘p_conDecl’ 2020-05-28 09:16:25 +02:00
Mark Karpov
06f2cf4eff
Minor refactoring in ‘p_typeSig’ 2020-05-27 17:06:29 +02:00
Mark Karpov
78e2d3df4c
Introduce ‘commaDel’ 2020-05-27 16:12:43 +02:00
Mark Karpov
c84eaa9f7a
Output space using ‘space’ in ‘sepSemi’ 2020-05-27 15:51:27 +02:00
Mark Karpov
2ed76cc147
Derive ‘Eq’ and ‘Show’ for ‘BracketStyle’ 2020-05-27 15:45:24 +02:00
Mark Karpov
a44fdeaae1 Remove redundant ‘sitcc’ 2020-05-27 15:29:53 +02:00
Mark Karpov
ef07eb8503
Simplify the code for rendering of unboxed sums 2020-05-27 13:19:21 +02:00
Jonas
9e11a5c1b2 Remove duplicate LIE's from import lists 2020-05-26 12:04:53 +02:00
Mark Karpov
5f631015b0
Fix a typo in the changelog
[skip ci]
2020-05-25 21:04:46 +02:00
Mark Karpov
409c1f9aa8
Version bump (0.1.0.0)
[skip ci]
2020-05-25 20:49:06 +02:00
Mark Karpov
8eac6bb7a0 Fix an idempotence issue with operators chains 2020-05-25 16:19:37 +02:00
Mark Karpov
1fb65a218c Fix non-idempotent transformation of partly documented data definition 2020-05-15 12:21:27 +02:00
Mark Karpov
b0092e11a1 Fix another case of non-idempotence with inline comments 2020-05-14 15:45:01 +02:00
Mark Karpov
76c4f523d7 Fix rendering of unnamed fields of data constructors 2020-05-13 15:37:07 +02:00
Mark Karpov
a5c4d6c439 Improve rendering of comments around if expressions 2020-05-11 16:47:37 +02:00
Mark Karpov
06173266c6
Mention the fix for 518 in the changelog 2020-05-11 14:59:20 +02:00
Mark Karpov
6ecae36922 Fix the false positive about AST differences
Comments that have more than one consecutive blank line will be rendered
with just a single blank line due to how our rendering engine works. I think
that the engine work correctly in this case and we want to generally
normalize blank lines. So what should be fixed is just the check. For that
we remove extra consecutive blank lines when we construct ‘Comment’ values.
2020-05-11 13:58:48 +02:00
Mark Karpov
60752a2853 Fixed an idempotence issue in type synonym and data declarations 2020-05-07 19:29:52 +02:00
Mark Karpov
eb8bccd469
Fix a typo in the changelog 2020-05-06 23:15:16 +02:00
Mark Karpov
0abedcce03 Prevent the equality sign from “disconnecting” comments
This resolves a class of idempotence issues when the equality sign happens
to be inserted between an element and its comment that follows on the same
line. I had to special-case equality sign for this, because all alternative
approaches (changing comment association logic or trying to find a more
general rule) did not work or fixed this issue yet made other things worse.

There is nothing special about the equality sign per se, but it (always?)
starts definitions which have their own ‘Located’ wrappers and it is those
spans interfere with the logic of comment association (they are detected as
AST elements between the “host” element and its comment) on subsequent
passes. This results in non-idempotent formatting.

The solution is OKish in that it fixes 99% of problems that one will
encounter in practice, but I see how an input can be crafted to show that
there is still an issue with idempotence.
2020-05-06 23:03:57 +02:00
Mark Karpov
194da3a19f Fix the difference in indentation levels in a comment series 2020-05-05 14:05:24 +02:00
Mark Karpov
991bf8e24d Prevent incorrect detection of continuations of comment series 2020-05-04 19:02:42 +02:00
Mark Karpov
22839ed74c Improve tracking of dirty lines, better hang expressions in records 2020-04-29 18:12:42 +02:00
Mark Karpov
3fbc130a09 Factor out the ‘isModule’ function and the use of module span
Module span is dummy and misleading. Right now it is not used at all, but we
still organize code as if it were used.
2020-04-27 17:58:54 +02:00
Mark Karpov
5d1612f153 Replace “idempotency” with “idempotence” 2020-04-27 15:16:40 +02:00
Mark Karpov
bc621311dd
Mention the fix for 566 in the changelog 2020-04-26 22:48:04 +02:00