1
1
mirror of https://github.com/google/ormolu.git synced 2024-11-29 11:02:29 +03:00

Group StandaloneKindSignatures with type synonyms

This commit is contained in:
amesgen 2021-02-01 22:05:40 +01:00 committed by Mark Karpov
parent 4e01690e05
commit 34bdf62429
No known key found for this signature in database
GPG Key ID: 8564658B2889FF7C
5 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,8 @@
## Unreleased
* Now standalone kind signatures are grouped with type synonyms. [Issue
683](https://github.com/tweag/ormolu/issues/683).
## Ormolu 0.1.4.1
* Added command line option `--color` to control how diffs are printed.

View File

@ -11,3 +11,6 @@ class C1 a
type F :: Type -> Type
type family F
type G :: Type
type G = a

View File

@ -11,3 +11,7 @@ class C1 a
type F :: Type -> Type
type family F
type G :: Type
type G = a

View File

@ -141,6 +141,9 @@ library
else
ghc-options: -O2 -Wall
if impl(ghc <8.10.0)
ghc-options: -fmax-pmcheck-iterations=3000000
executable ormolu
main-is: Main.hs
hs-source-dirs: app

View File

@ -188,6 +188,7 @@ groupedDecls (L l_x x') (L l_y y') =
(KindSignature n, DataDeclaration n') -> n == n'
(KindSignature n, ClassDeclaration n') -> n == n'
(KindSignature n, FamilyDeclaration n') -> n == n'
(KindSignature n, TypeSynonym n') -> n == n'
-- Special case for TH splices, we look at locations
(Splice, Splice) -> not (separatedByBlank id l_x l_y)
-- This looks only at Haddocks, normal comments are handled elsewhere
@ -247,7 +248,8 @@ pattern
DataDeclaration,
ClassDeclaration,
KindSignature,
FamilyDeclaration ::
FamilyDeclaration,
TypeSynonym ::
RdrName -> HsDecl GhcPs
pattern InlinePragma n <- SigD NoExtField (InlineSig NoExtField (L _ n) _)
pattern SpecializePragma n <- SigD NoExtField (SpecSig NoExtField (L _ n) _ _)
@ -259,6 +261,7 @@ pattern DataDeclaration n <- TyClD NoExtField (DataDecl NoExtField (L _ n) _ _ _
pattern ClassDeclaration n <- TyClD NoExtField (ClassDecl NoExtField _ (L _ n) _ _ _ _ _ _ _ _)
pattern KindSignature n <- KindSigD NoExtField (StandaloneKindSig NoExtField (L _ n) _)
pattern FamilyDeclaration n <- TyClD NoExtField (FamDecl NoExtField (FamilyDecl NoExtField _ (L _ n) _ _ _ _))
pattern TypeSynonym n <- TyClD NoExtField (SynDecl NoExtField (L _ n) _ _ _)
-- Declarations which can refer to multiple names