Skip to content

Commit 65a8512

Browse files
authored
Add space after comma when exporting a name (#2547)
* Add space after comma when exporting a name * Fix tests
1 parent 7518a3a commit 65a8512

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ghcide/src/Development/IDE/Plugin/CodeAction.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ suggestExportUnusedTopBinding srcOpt ParsedModule{pm_parsed_source = L _ HsModul
541541
$ hsmodDecls
542542
, Just pos <- fmap _end . getLocatedRange =<< hsmodExports
543543
, Just needComma <- needsComma source <$> hsmodExports
544-
, let exportName = (if needComma then "," else "") <> printExport exportType name
544+
, let exportName = (if needComma then ", " else "") <> printExport exportType name
545545
insertPos = pos {_character = pred $ _character pos}
546546
= [("Export ‘" <> name <> "", TextEdit (Range insertPos insertPos) exportName)]
547547
| otherwise = []

ghcide/test/exe/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3367,7 +3367,7 @@ exportUnusedTests = testGroup "export unused actions"
33673367
"Export ‘bar’"
33683368
(Just $ T.unlines
33693369
[ "{-# OPTIONS_GHC -Wunused-top-binds #-}"
3370-
, "module A (foo,bar) where"
3370+
, "module A (foo, bar) where"
33713371
, "foo = id"
33723372
, "bar = foo"])
33733373
, testSession "multi line explicit exports" $ template
@@ -3384,7 +3384,7 @@ exportUnusedTests = testGroup "export unused actions"
33843384
[ "{-# OPTIONS_GHC -Wunused-top-binds #-}"
33853385
, "module A"
33863386
, " ("
3387-
, " foo,bar) where"
3387+
, " foo, bar) where"
33883388
, "foo = id"
33893389
, "bar = foo"])
33903390
, testSession "export list ends in comma" $ template

0 commit comments

Comments
 (0)