Skip to content

Commit da8b540

Browse files
authored
Fix missing space in import suffix formatting (#485)
1 parent 9e40fff commit da8b540

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

src/Dhall/Core.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ instance Pretty Import where
222222
where
223223
suffix :: Text
224224
suffix = case importMode of
225-
RawText -> "as Text"
225+
RawText -> " as Text"
226226
Code -> ""
227227

228228
-- | Type synonym for `Import`, provided for backwards compatibility

tests/Format.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ formatTests =
5151
, should
5252
"handle formatting sha256 imports correctly"
5353
"sha256Printing"
54+
, should
55+
"handle formatting of Import suffix correctly"
56+
"importSuffix"
5457
]
5558

5659
opts :: Data.Text.Prettyprint.Doc.LayoutOptions

tests/format/importSuffixA.dhall

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let a = env:AAA as Text in a

tests/format/importSuffixB.dhall

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let a = env:AAA as Text in a

0 commit comments

Comments
 (0)