Fix indentation in presence of type applications
commit6ee0365f2c2aa58763f05e84ac32f1e76d3fe627
authorMark Karpov <mark.karpov@tweag.io>
dateFri 10 Jan 2020, 16:27 (7 years ago)
parent1eefa97
CHANGELOG.md+3
@@ -15,6 +15,9 @@
1515 potentially-hanging consturctions in the presence of comments. [Issue
1616 447](https://github.com/tweag/ormolu/issues/447).
1717
18+* Fixed indentation in presence of type applications. [Issue
19+ 493](https://github.com/tweag/ormolu/issues/493).
20+
1821## Ormolu 0.0.2.0
1922
2023* Switched to `ghc-lib-parser` instead of depending on the `ghc` package
data/examples/declaration/value/function/type-applications-out.hs+6
@@ -8,3 +8,9 @@ baz =
88 f @Int @String
99 a
1010 b
11+
12+goo =
13+ hash
14+ @(HASH TPraosStandardCrypto)
15+ @ByteString
16+ "And the lamb lies down on Broadway"
data/examples/declaration/value/function/type-applications.hs+5
@@ -6,3 +6,8 @@ bar = f @(Maybe Int) a b
66
77baz = f @Int @String
88 a b
9+
10+goo = hash
11+ @(HASH TPraosStandardCrypto)
12+ @ByteString
13+ "And the lamb lies down on Broadway"
src/Ormolu/Printer/Meat/Declaration/Value.hs+1
@@ -565,6 +565,7 @@ p_hsExpr' s = \case
565565 indent =
566566 case func of
567567 L _ (HsPar NoExt _) -> inci
568+ L _ (HsAppType NoExt _ _) -> inci
568569 L _ (HsMultiIf NoExt _) -> inci
569570 L spn _ ->
570571 if isOneLineSpan spn