1
1
mirror of https://github.com/google/ormolu.git synced 2024-10-05 12:17:09 +03:00

Fix a weird formatting on RecordDotSyntax support. (#3)

This commit is contained in:
Javran Cheng 2021-02-17 14:24:05 -08:00 committed by GitHub
parent 24fd712462
commit d186cdf5ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 7 deletions

View File

@ -1,10 +1,12 @@
{-# OPTIONS_GHC -fplugin=RecordDotPreprocessor #-}
bar' =
(Foo 1){bar = 2
}
(Foo 1)
{ bar = 2
}
fooplus'''' f n =
f{foo = n
f
{ foo = n
, bar = n
}
}

View File

@ -6,7 +6,7 @@ mfoo = fmap (.bar) $ Nothing
bar = (Foo 1).bar
fooplus f n = f{foo = f.bar + n}
fooplus f n = f {foo = f.bar + n}
fooplus' f n = f {foo = f.bar + n}

View File

@ -228,7 +228,9 @@ braces = brackets_ False "{" "}"
--
-- @since 0.1.3.1
recordDotBraces :: R () -> R ()
recordDotBraces m = sitcc (vlayout singleLine multiLine)
recordDotBraces m = do
breakpoint
inci $ vlayout singleLine multiLine
where
singleLine = do
txt "{"
@ -236,7 +238,8 @@ recordDotBraces m = sitcc (vlayout singleLine multiLine)
txt "}"
multiLine = do
txt "{"
sitcc m
space
m
newline
txt "}"