diff --git a/ghcide/src/Development/IDE/GHC/ExactPrint.hs b/ghcide/src/Development/IDE/GHC/ExactPrint.hs index c74c94dd6c..b231044bc5 100644 --- a/ghcide/src/Development/IDE/GHC/ExactPrint.hs +++ b/ghcide/src/Development/IDE/GHC/ExactPrint.hs @@ -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 diff --git a/plugins/hls-tactics-plugin/test/CodeAction/IntrosSpec.hs b/plugins/hls-tactics-plugin/test/CodeAction/IntrosSpec.hs index 254ec68522..da2aaaa273 100644 --- a/plugins/hls-tactics-plugin/test/CodeAction/IntrosSpec.hs +++ b/plugins/hls-tactics-plugin/test/CodeAction/IntrosSpec.hs @@ -14,3 +14,6 @@ spec = do describe "golden" $ do introsTest 2 8 "GoldenIntros" + describe "layout" $ do + introsTest 4 24 "LayoutRec" + diff --git a/plugins/hls-tactics-plugin/test/golden/LayoutRec.expected.hs b/plugins/hls-tactics-plugin/test/golden/LayoutRec.expected.hs new file mode 100644 index 0000000000..9818d23e5e --- /dev/null +++ b/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 -> _} + diff --git a/plugins/hls-tactics-plugin/test/golden/LayoutRec.hs b/plugins/hls-tactics-plugin/test/golden/LayoutRec.hs new file mode 100644 index 0000000000..47a9895c2e --- /dev/null +++ b/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 = _} +