X-Git-Url: http://git.lukelau.me/?p=lsp-test.git;a=blobdiff_plain;f=test%2FTest.hs;h=88c6852eadd43d885bc5cef1217bee08cffe18e8;hp=d524ee4ffe15c666c8feaabdd5c518e804782a58;hb=70093bf4d0c35a5639a37f1c7946bba44ac76ca6;hpb=1e6ddec86c84d44fa756430c803f2be9ebf8baa9 diff --git a/test/Test.hs b/test/Test.hs index d524ee4..88c6852 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -176,6 +176,13 @@ main = hspec $ do liftIO $ contents `shouldBe` "main :: IO Int\nmain = return 42\n" noDiagnostics + describe "getCodeActions" $ + it "works" $ runSession "hie" fullCaps "test/data/refactor" $ do + doc <- openDoc "Main.hs" "haskell" + waitForDiagnostics + [CACodeAction action] <- getCodeActions doc (Range (Position 1 14) (Position 1 18)) + liftIO $ action ^. title `shouldBe` "Apply hint:Redundant bracket" + describe "getAllCodeActions" $ it "works" $ runSession "hie --lsp" fullCaps "test/data/refactor" $ do doc <- openDoc "Main.hs" "haskell"