Commit Graph

184 Commits (56ccbc91a80c5f8c24dfda99c8da881541c6bbc9)

Author SHA1 Message Date
Taylor Fausak b517eef71e Fix handling of type families 2021-11-06 16:46:24 +00:00
Taylor Fausak bfdb28010a Restore custom `Show` instance for `PPTextWrapper` 2021-11-04 23:05:43 +00:00
Taylor Fausak 515595b432 Append final newline 2021-10-30 16:28:34 +00:00
Joe Hermaszewski 9efed95d50 Add tests for import sorting 2020-11-20 23:03:59 +08:00
Joe Hermaszewski f67e72e82c Merge remote-tracking branch 'origin/gh-269-ghc-8.10' into imports-sorted 2020-11-20 22:20:52 +08:00
Taylor Fausak d00387d156
Remove broken test case 2020-11-20 08:53:08 -05:00
Taylor Fausak 71e7f52014
Remove broken test case 2020-11-20 08:52:28 -05:00
Lennart Spitzner 93ea6542cc Fix existing tests for new import layouter behaviour 2020-11-19 09:00:45 +08:00
Taylor Fausak 682f08c562
Merge pull request #313 from expipiplus1/joe-exportlist
nondecreasing export list formatting
2020-10-20 16:35:21 -04:00
Joe Hermaszewski 64417c59f4 nondecreasing export list formatting 2020-08-29 13:26:36 +08:00
Lennart Spitzner 5c64928972 Fix problem of do notation as left argument of an operator 2020-04-21 01:34:46 +02:00
Lennart Spitzner df2ee177b2 Fix comments in instance/type instances (#282) 2020-03-23 16:51:30 +01:00
Lennart Spitzner 7b5c0dc4e3
Merge pull request #287 from RaoulHC/pattern-synonyms
Add support for pattern synonyms
2020-03-23 16:50:50 +01:00
Lennart Spitzner ae0e397fac Disable one test-case for ghc-8.0 (unsupported syntax) 2020-03-22 22:44:13 +01:00
Lennart Spitzner 3631f6aec3 Add another testcase for bidirectional pattern synonyms 2020-03-21 22:05:21 +01:00
Lennart Spitzner b546b514b0 Add a testcase for PatternSynonym decls (needs fixing) 2020-03-21 22:05:21 +01:00
Lennart Spitzner 9236673d66 Fix newtype indent in associated type family (#207) 2020-03-13 01:23:17 +01:00
Raoul Hidalgo Charman dfa3fef56c Add support for pattern synonyms 2020-03-08 19:30:23 +00:00
Lennart Spitzner 4b673d1d9d Fix bug in record layouting causing overflows 2020-02-25 17:55:20 +01:00
Lennart Spitzner a3b501051a Add proper multiline layout for type-level-lists 2020-02-23 23:33:03 +01:00
Lennart Spitzner 38cdd15221 Fix moving comment in export list (haddock header) (#281) 2020-02-13 19:05:05 +01:00
Lennart Spitzner 825ec425d4 Improve comments-affecting-layout behaviour for tuples (#231) 2020-02-13 19:04:49 +01:00
Lennart Spitzner 5895f954bd Remove dependency on neat-interpolation 2020-02-04 16:14:38 +01:00
Lennart Spitzner 03e2b62c24 Introduce flag to disable formatting per-module
New inline config `-- brittany-disable` that parses but
ignores the current module. Useful if both brittany
and ghc-exactprint bug out for some syntax.
2020-01-23 13:56:25 +01:00
Lennart Spitzner 128dd828c2 Fix newline issue on comments before where 2020-01-11 23:19:04 +01:00
Lennart Spitzner 2b303b2a20 Fix additional indentation bug for let-in 2020-01-10 16:32:18 +01:00
Lennart Spitzner 6724760f40 Fix non-idempotent newlines with comment + where (#263) 2019-12-20 01:12:25 +01:00
Lennart Spitzner 00c6854887 Fix two minor data-decl layouting issues 2019-12-09 22:35:26 +01:00
Lennart Spitzner a1282c3ac6 Add a testcase for the last commit 2019-12-09 11:22:43 -07:00
Lennart Spitzner 6c3d9c57c5 Comment the single-line record decl config flag out 2019-12-09 11:22:43 -07:00
Lennart Spitzner 5a49277eba Improve data decl layouting
- Fix bug in BackendUtil/lowest level of brittany about
  alignment being ignored after a comment,
- Properly layout large (more than single-line) types in
  record fields and in data decl rhs arguments,
- Properly layout data decl constructors with large "heads"
  (forall, constraints),
- Add a config flag to control single-line layout of record
  definition,
2019-12-09 11:20:28 -07:00
Evan Rutledge Borden 80f370a8e1 Support nullary data types
Add tests for nullary prefix data types and nullary record data types.
2019-12-09 11:17:32 -07:00
Lennart Spitzner 0381b9fe24 Fix record field comment indentation 2019-12-09 11:17:32 -07:00
Lennart Spitzner c367b1017b Fixup src-literatetests/Main formatting 2019-12-09 11:17:32 -07:00
Evan Rutledge Borden 9494d6203a Allow multi line formatting of normal records
Only single line formatting of normal records was being supported. For
records with long names we need multi line formatting. This also needs
to support both multi and left indentation policies.
2019-12-09 11:17:32 -07:00
Lennart Spitzner a23ef696e8 Fix test failure: DerivingStrategies exists since ghc-8.2 2019-12-09 11:17:32 -07:00
Lennart Spitzner 54f34344b3 Implement #min-ghc keyword for test script 2019-12-09 11:17:32 -07:00
Lennart Spitzner 48490a7110 Fix handling of comment before data-decl
`docWrapNodePrior` caused duplication of offset of `data` keyword
and of comments connected to it.
2019-12-09 11:17:31 -07:00
Evan Rutledge Borden b2f4262749 Isolate deriving via test 2019-12-09 11:17:31 -07:00
Lennart Spitzner 2f6967b7b8 Support comments in record data decls 2019-12-09 11:17:31 -07:00
Lennart Spitzner d21ecf89e6 Fix a comment bug in tuple-type layouting 2019-12-09 11:17:31 -07:00
Evan Rutledge Borden 57ba88a73c Work-in-progress add record declaration layout
Simple records are supports. The tests cover:

- single records
- multi-field types
- columnized alignment
- basic deriving
- deriving strategies
- existential quanitification

A few items block merger

- retaining comments

A few items can be deferred:

- normal types
- sum types
2019-12-09 11:17:31 -07:00
Lennart Spitzner 4f827491da Work-in-progress commit (deriving clause..) 2019-12-09 11:17:31 -07:00
Lennart Spitzner e24271318d Improve record-expression layouting
- Finish consolidation, clearing a TODO
- Fix two comment placement issues around record wildcards
- Fix regression in brittany-0.12 about layouting large
  (multiline) record field updates
2019-12-05 14:30:50 +01:00
Lennart Spitzner f87c0c64b8 Implement experimental semicolon-into-newlines feature 2019-12-04 13:55:41 +01:00
Lennart Spitzner 77d6d5b553 Fix roundtripping of (~) constraint/type 2019-11-27 22:21:16 +01:00
Lennart Spitzner 974826f98f Fix whitespace regression on forall+constraint type sig 2019-11-08 12:11:35 +01:00
Lennart Spitzner 0795a39806 Fix infix matches with more than 2 args, fixes #219 2019-09-19 00:48:59 +02:00
Lennart Spitzner 6879436e67 Fix lambdas with lazy/bang pattern as first argument 2019-09-03 01:10:38 +02:00
Lennart Spitzner 702b993dab Fix prefix operator pattern-match invalid result 2019-09-03 00:23:58 +02:00