Add support for TypeDefinitionRequest
[lsp-test.git] / test / Test.hs
index f73c18606bee24d24d86c70347d3bfc81c61c5dd..c5b02e8f91842c85d07b07cd1198dcffc7ee530e 100644 (file)
@@ -259,6 +259,13 @@ main = hspec $ do
       defs <- getDefinitions doc pos
       liftIO $ defs `shouldBe` [Location (doc ^. uri) (mkRange 28 0 28 7)]
 
+  describe "getTypeDefinitions" $
+    it "works" $ runSession "hie" fullCaps "test/data/renamePass" $ do
+      doc <- openDoc "Desktop/simple.hs" "haskell"
+      let pos = Position 20 23  -- Quit value
+      defs <- getTypeDefinitions doc pos
+      liftIO $ defs `shouldBe` [Location (doc ^. uri) (mkRange 10 15 10 19)]  -- First constructor
+
   describe "waitForDiagnosticsSource" $
     it "works" $ runSession "hie" fullCaps "test/data" $ do
       openDoc "Error.hs" "haskell"