Add getCodeActions, getCurrentDiagnostics, bump
[lsp-test.git] / test / Test.hs
index d524ee4ffe15c666c8feaabdd5c518e804782a58..88c6852eadd43d885bc5cef1217bee08cffe18e8 100644 (file)
@@ -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"