Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 8f18e45

Browse files
committed
Add spaces to the correct positions
1 parent bcac2b5 commit 8f18e45

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/Haskell/Ide/Engine/Plugin/HsImport.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -437,15 +437,15 @@ codeActionProvider plId docId _ context = do
437437
title = "Import module "
438438
<> modName
439439
<> case termType importDiagnostic of
440-
Hiding _ -> "hiding "
440+
Hiding _ -> "hiding"
441441
-- ^ Note, that it must never happen
442442
-- in combination with `symbolType == Nothing`
443-
Import _ -> " "
443+
Import _ -> ""
444444
<> case symbolType of
445445
Just s -> case s of
446-
Only sym -> "(" <> sym <> ")"
447-
AllOf dt -> "(" <> dt <> " (..))"
448-
OneOf dt sym -> "(" <> dt <> " (" <> sym <> "))"
446+
Only sym -> " (" <> sym <> ")"
447+
AllOf dt -> " (" <> dt <> " (..))"
448+
OneOf dt sym -> " (" <> dt <> " (" <> sym <> "))"
449449
Nothing -> ""
450450

451451
importStyleParam :: ImportStyle

test/functional/FunctionalCodeActionsSpec.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -685,13 +685,13 @@ hsImportSpec formatterName [e1, e2, e3, e4] =
685685
let config = def { formatOnImportOn = False, formattingProvider = formatterName }
686686
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))
687687

688-
let wantedCodeActionTitles = [ "Import module System.IO (hPutSetrLn)"
689-
, "Import module System.IO (stdout)"
688+
let wantedCodeActionTitles = [ "Import module System.IO (hPutStrLn)"
690689
, "Import module Control.Monad (when)"
691690
, "Import module Data.Maybe (fromMaybe)"
692691
, "Import module Data.Function (($))"
693-
, "Import module Data.Maybe (Maybe(Just))"
694-
, "Import module Prelude (Bool(..))"
692+
, "Import module Data.Maybe (Maybe (Just))"
693+
, "Import module Prelude (Bool (..))"
694+
, "Import module System.IO (stdout)"
695695
]
696696

697697
executeAllCodeActions doc wantedCodeActionTitles
@@ -708,12 +708,12 @@ hsImportSpec formatterName [e1, e2, e3, e4] =
708708
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))
709709

710710
let wantedCodeActionTitles = [ "Import module System.IO (hPutStrLn)"
711-
, "Import module System.IO (stdout)"
712711
, "Import module Control.Monad (when)"
713712
, "Import module Data.Maybe (fromMaybe)"
714713
, "Import module Data.Function (($))"
715-
, "Import module Data.Maybe (Maybe(Just))"
716-
, "Import module Prelude (Bool(..))"
714+
, "Import module Data.Maybe (Maybe (Just))"
715+
, "Import module Prelude (Bool (..))"
716+
, "Import module System.IO (stdout)"
717717
]
718718

719719
executeAllCodeActions doc wantedCodeActionTitles
@@ -754,7 +754,7 @@ hsImportSpec formatterName [e1, e2, e3, e4] =
754754
error
755755
$ "Found an unexpected amount of action. Expected 1, but got: "
756756
++ show (length xs)
757-
++ "\n. Titles: " ++ show (map (^. L.title) allActions)
757+
++ ".\n Titles: " ++ show (map (^. L.title) allActions)
758758

759759
-- Silence warnings
760760
hsImportSpec formatter args =

0 commit comments

Comments
 (0)