Skip to content

Commit

Permalink
Fix record layout (haskell#1851)
Browse files Browse the repository at this point in the history
* Fix record layout

* Don't change the record update rules

Co-authored-by: Junyoung/Clare Jang <[email protected]>
Co-authored-by: Potato Hatsue <[email protected]>
  • Loading branch information
3 people authored May 21, 2021
1 parent a06b2e6 commit 37e0551
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ghcide/src/Development/IDE/GHC/ExactPrint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ needsParensSpace HsMultiIf{} = (All False, All False)
needsParensSpace HsLet{} = (All False, All True)
needsParensSpace HsDo{} = (All False, All False)
needsParensSpace ExplicitList{} = (All False, All False)
needsParensSpace RecordCon{} = (All False, All False)
needsParensSpace RecordCon{} = (All False, All True)
needsParensSpace RecordUpd{} = mempty
needsParensSpace _ = mempty

Expand Down
3 changes: 3 additions & 0 deletions plugins/hls-tactics-plugin/test/CodeAction/IntrosSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ spec = do
describe "golden" $ do
introsTest 2 8 "GoldenIntros"

describe "layout" $ do
introsTest 4 24 "LayoutRec"

5 changes: 5 additions & 0 deletions plugins/hls-tactics-plugin/test/golden/LayoutRec.expected.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data Pair a b = Pair {pa :: a, pb :: b}

p :: Pair (a -> a) (a -> b -> c -> b)
p = Pair {pa = _, pb = \ a b c -> _}

5 changes: 5 additions & 0 deletions plugins/hls-tactics-plugin/test/golden/LayoutRec.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data Pair a b = Pair {pa :: a, pb :: b}

p :: Pair (a -> a) (a -> b -> c -> b)
p = Pair {pa = _, pb = _}

0 comments on commit 37e0551

Please sign in to comment.