Skip to content

Commit c82695a

Browse files
dschrempffendor
authored andcommitted
code actions: consistent spelling of "Replace"
1 parent 9891292 commit c82695a

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

ghcide/test/exe/ResolveTests.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import qualified Language.LSP.Protocol.Lens as JL
2020
import Language.LSP.Protocol.Message (SomeMethod (..))
2121
import qualified Language.LSP.Protocol.Message as LSP
2222
import Language.LSP.Protocol.Types
23-
import Language.LSP.Test
23+
import Language.LSP.Test hiding (resolveCompletion)
2424
import Test.Hls (IdeState, SMethod (..), liftIO,
2525
mkPluginTestDescriptor,
2626
someMethodToMethodString,

plugins/hls-refactor-plugin/src/Development/IDE/Plugin/CodeAction.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ suggestModuleTypo Diagnostic{_range=_range,..}
947947
| "Could not find module" `T.isInfixOf` _message =
948948
case T.splitOn "Perhaps you meant" _message of
949949
[_, stuff] ->
950-
[ ("replace with " <> modul, TextEdit _range modul)
950+
[ ("Replace with " <> modul, TextEdit _range modul)
951951
| modul <- mapMaybe extractModule (T.lines stuff)
952952
]
953953
_ -> []

plugins/hls-refactor-plugin/src/Development/IDE/Plugin/Plugins/FillHole.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ suggestFillHole Diagnostic{_range=_range,..}
2929
Just (firstChr, _) ->
3030
let isInfixOperator = firstChr == '('
3131
name' = getOperatorNotation isInfixHole isInfixOperator name in
32-
( "replace " <> holeName <> " with " <> name
32+
( "Replace " <> holeName <> " with " <> name
3333
, TextEdit _range (if parenthise then addParens name' else name')
3434
)
3535
getOperatorNotation True False name = addBackticks name

plugins/hls-refactor-plugin/test/Main.hs

+18-18
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ fixModuleImportTypoTests = testGroup "fix module import typo"
16611661
[ testSession "works when single module suggested" $ do
16621662
doc <- createDoc "A.hs" "haskell" "import Data.Cha"
16631663
_ <- waitForDiagnostics
1664-
action <- pickActionWithTitle "replace with Data.Char" =<< getCodeActions doc (R 0 0 0 10)
1664+
action <- pickActionWithTitle "Replace with Data.Char" =<< getCodeActions doc (R 0 0 0 10)
16651665
executeCodeAction action
16661666
contentAfterAction <- documentContents doc
16671667
liftIO $ contentAfterAction @?= "import Data.Char"
@@ -1670,11 +1670,11 @@ fixModuleImportTypoTests = testGroup "fix module import typo"
16701670
_ <- waitForDiagnostics
16711671
actions <- getCodeActions doc (R 0 0 0 10)
16721672
traverse_ (assertActionWithTitle actions)
1673-
[ "replace with Data.Eq"
1674-
, "replace with Data.Int"
1675-
, "replace with Data.Ix"
1673+
[ "Replace with Data.Eq"
1674+
, "Replace with Data.Int"
1675+
, "Replace with Data.Ix"
16761676
]
1677-
replaceWithDataEq <- pickActionWithTitle "replace with Data.Eq" actions
1677+
replaceWithDataEq <- pickActionWithTitle "Replace with Data.Eq" actions
16781678
executeCodeAction replaceWithDataEq
16791679
contentAfterAction <- documentContents doc
16801680
liftIO $ contentAfterAction @?= "import Data.Eq"
@@ -2640,7 +2640,7 @@ importRenameActionTests = testGroup "import rename actions" $
26402640
where
26412641
check modname = checkCodeAction
26422642
("Data.Mape -> Data." <> T.unpack modname)
2643-
("replace with Data." <> modname)
2643+
("Replace with Data." <> modname)
26442644
(T.unlines
26452645
[ "module Testing where"
26462646
, "import Data.Mape"
@@ -2686,33 +2686,33 @@ fillTypedHoleTests = let
26862686
liftIO $ expectedCode @=? modifiedCode
26872687
in
26882688
testGroup "fill typed holes"
2689-
[ check "replace _ with show"
2689+
[ check "Replace _ with show"
26902690
"_" "n" "n"
26912691
"show" "n" "n"
26922692

2693-
, check "replace _ with globalConvert"
2693+
, check "Replace _ with globalConvert"
26942694
"_" "n" "n"
26952695
"globalConvert" "n" "n"
26962696

2697-
, check "replace _convertme with localConvert"
2697+
, check "Replace _convertme with localConvert"
26982698
"_convertme" "n" "n"
26992699
"localConvert" "n" "n"
27002700

2701-
, check "replace _b with globalInt"
2701+
, check "Replace _b with globalInt"
27022702
"_a" "_b" "_c"
27032703
"_a" "globalInt" "_c"
27042704

2705-
, check "replace _c with globalInt"
2705+
, check "Replace _c with globalInt"
27062706
"_a" "_b" "_c"
27072707
"_a" "_b" "globalInt"
27082708

2709-
, check "replace _c with parameterInt"
2709+
, check "Replace _c with parameterInt"
27102710
"_a" "_b" "_c"
27112711
"_a" "_b" "parameterInt"
2712-
, check "replace _ with foo _"
2712+
, check "Replace _ with foo _"
27132713
"_" "n" "n"
27142714
"(foo _)" "n" "n"
2715-
, testSession "replace _toException with E.toException" $ do
2715+
, testSession "Replace _toException with E.toException" $ do
27162716
let mkDoc x = T.unlines
27172717
[ "module Testing where"
27182718
, "import qualified Control.Exception as E"
@@ -2721,7 +2721,7 @@ fillTypedHoleTests = let
27212721
doc <- createDoc "Test.hs" "haskell" $ mkDoc "_toException"
27222722
_ <- waitForDiagnostics
27232723
actions <- getCodeActions doc (Range (Position 3 0) (Position 3 maxBound))
2724-
chosen <- pickActionWithTitle "replace _toException with E.toException" actions
2724+
chosen <- pickActionWithTitle "Replace _toException with E.toException" actions
27252725
executeCodeAction chosen
27262726
modifiedCode <- documentContents doc
27272727
liftIO $ mkDoc "E.toException" @=? modifiedCode
@@ -2737,7 +2737,7 @@ fillTypedHoleTests = let
27372737
doc <- createDoc "Test.hs" "haskell" $ mkDoc "`_`"
27382738
_ <- waitForDiagnostics
27392739
actions <- getCodeActions doc (Range (Position 5 16) (Position 5 19))
2740-
chosen <- pickActionWithTitle "replace _ with foo" actions
2740+
chosen <- pickActionWithTitle "Replace _ with foo" actions
27412741
executeCodeAction chosen
27422742
modifiedCode <- documentContents doc
27432743
liftIO $ mkDoc "`foo`" @=? modifiedCode
@@ -2750,7 +2750,7 @@ fillTypedHoleTests = let
27502750
doc <- createDoc "Test.hs" "haskell" $ mkDoc "_"
27512751
_ <- waitForDiagnostics
27522752
actions <- getCodeActions doc (Range (Position 2 13) (Position 2 14))
2753-
chosen <- pickActionWithTitle "replace _ with (<$>)" actions
2753+
chosen <- pickActionWithTitle "Replace _ with (<$>)" actions
27542754
executeCodeAction chosen
27552755
modifiedCode <- documentContents doc
27562756
liftIO $ mkDoc "(<$>)" @=? modifiedCode
@@ -2763,7 +2763,7 @@ fillTypedHoleTests = let
27632763
doc <- createDoc "Test.hs" "haskell" $ mkDoc "`_`"
27642764
_ <- waitForDiagnostics
27652765
actions <- getCodeActions doc (Range (Position 2 16) (Position 2 19))
2766-
chosen <- pickActionWithTitle "replace _ with (<$>)" actions
2766+
chosen <- pickActionWithTitle "Replace _ with (<$>)" actions
27672767
executeCodeAction chosen
27682768
modifiedCode <- documentContents doc
27692769
liftIO $ mkDoc "<$>" @=? modifiedCode

0 commit comments

Comments
 (0)