From b6e288e825a7979b7ae83c0ec565a28214757a0d Mon Sep 17 00:00:00 2001 From: Sergey Vinokurov Date: Mon, 27 Dec 2021 14:37:08 +0000 Subject: [PATCH 1/2] Add space after comma when exporting a name --- ghcide/src/Development/IDE/Plugin/CodeAction.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghcide/src/Development/IDE/Plugin/CodeAction.hs b/ghcide/src/Development/IDE/Plugin/CodeAction.hs index cfcba318f8..57213ddf96 100644 --- a/ghcide/src/Development/IDE/Plugin/CodeAction.hs +++ b/ghcide/src/Development/IDE/Plugin/CodeAction.hs @@ -541,7 +541,7 @@ suggestExportUnusedTopBinding srcOpt ParsedModule{pm_parsed_source = L _ HsModul $ hsmodDecls , Just pos <- fmap _end . getLocatedRange =<< hsmodExports , Just needComma <- needsComma source <$> hsmodExports - , let exportName = (if needComma then "," else "") <> printExport exportType name + , let exportName = (if needComma then ", " else "") <> printExport exportType name insertPos = pos {_character = pred $ _character pos} = [("Export β€˜" <> name <> "’", TextEdit (Range insertPos insertPos) exportName)] | otherwise = [] From 2c11aa094f42cfc2579bdf2cea6a71388e8fa780 Mon Sep 17 00:00:00 2001 From: Sergey Vinokurov Date: Wed, 29 Dec 2021 21:56:47 +0000 Subject: [PATCH 2/2] Fix tests --- ghcide/test/exe/Main.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghcide/test/exe/Main.hs b/ghcide/test/exe/Main.hs index 1400995d54..9e221a8e08 100644 --- a/ghcide/test/exe/Main.hs +++ b/ghcide/test/exe/Main.hs @@ -3367,7 +3367,7 @@ exportUnusedTests = testGroup "export unused actions" "Export β€˜bar’" (Just $ T.unlines [ "{-# OPTIONS_GHC -Wunused-top-binds #-}" - , "module A (foo,bar) where" + , "module A (foo, bar) where" , "foo = id" , "bar = foo"]) , testSession "multi line explicit exports" $ template @@ -3384,7 +3384,7 @@ exportUnusedTests = testGroup "export unused actions" [ "{-# OPTIONS_GHC -Wunused-top-binds #-}" , "module A" , " (" - , " foo,bar) where" + , " foo, bar) where" , "foo = id" , "bar = foo"]) , testSession "export list ends in comma" $ template