- describe "getReferences" $
- it "works" $ runSession "hie --lsp" "test/data/renamePass" $ do
- doc <- openDoc "Desktop/simple.hs" "haskell"
- let pos = Position 40 3 -- interactWithUser
- uri = doc ^. LSP.uri
- refs <- getReferences doc pos True
- liftIO $ refs `shouldContain` map (Location uri) [
- mkRange 41 0 41 16
- , mkRange 75 6 75 22
- , mkRange 71 6 71 22
- ]
-
- describe "getDefinitions" $
- it "works" $ runSession "hie --lsp" "test/data/renamePass" $ do
- doc <- openDoc "Desktop/simple.hs" "haskell"
- let pos = Position 49 25 -- addItem
- defs <- getDefinitions doc pos
- liftIO $ defs `shouldBe` [Location (doc ^. uri) (mkRange 28 0 28 7)]
+ comps <- getCompletions doc (Position 5 5)
+ let item = head comps
+ liftIO $ item ^. label `shouldBe` "foo"
+
+ -- describe "getReferences" $
+ -- it "works" $ runSession serverExe fullCaps "test/data/renamePass" $ do
+ -- doc <- openDoc "Desktop/simple.hs" "haskell"
+ -- let pos = Position 40 3 -- interactWithUser
+ -- uri = doc ^. LSP.uri
+ -- refs <- getReferences doc pos True
+ -- liftIO $ refs `shouldContain` map (Location uri) [
+ -- mkRange 41 0 41 16
+ -- , mkRange 75 6 75 22
+ -- , mkRange 71 6 71 22
+ -- ]
+
+ -- describe "getDefinitions" $
+ -- it "works" $ runSession serverExe fullCaps "test/data/renamePass" $ do
+ -- doc <- openDoc "Desktop/simple.hs" "haskell"
+ -- let pos = Position 49 25 -- addItem
+ -- defs <- getDefinitions doc pos
+ -- liftIO $ defs `shouldBe` [Location (doc ^. uri) (mkRange 28 0 28 7)]
+
+ -- describe "getTypeDefinitions" $
+ -- it "works" $ runSession serverExe 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 0 14 19)] -- Type definition