Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix record layout #1851

Merged
merged 4 commits into from May 21, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ghcide/src/Development/IDE/GHC/ExactPrint.hs
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
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
@@ -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
@@ -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 = _}