contents <- documentContents doc
liftIO $ contents `shouldSatisfy` T.isPrefixOf "foodule"
- -- describe "getCompletions" $
- -- it "works" $ runSession serverExe def "test/data/renamePass" $ do
- -- doc <- openDoc "Desktop/simple.hs" "haskell"
-
- -- -- wait for module to be loaded
- -- skipMany loggingNotification
- -- noDiagnostics
- -- noDiagnostics
+ describe "getCompletions" $
+ it "works" $ runSession serverExe def "test/data/renamePass" $ do
+ doc <- openDoc "Desktop/simple.hs" "haskell"
- -- comps <- getCompletions doc (Position 5 5)
- -- let item = head (filter (\x -> x ^. label == "interactWithUser") comps)
- -- liftIO $ do
- -- item ^. label `shouldBe` "interactWithUser"
- -- item ^. kind `shouldBe` Just CiFunction
- -- item ^. detail `shouldBe` Just "Items -> IO ()\nMain"
+ 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
it "keeps track" $ runSession serverExe fullCaps "test/data" $ do
loggingNotification -- initialized log message
- createDoc "register" "haskell" ""
+ createDoc ".register" "haskell" ""
message :: Session RegisterCapabilityRequest
doc <- createDoc "Foo.watch" "haskell" ""
]
-- now unregister it by sending a specific createDoc
- createDoc "unregister" "haskell" ""
+ createDoc ".unregister" "haskell" ""
message :: Session UnregisterCapabilityRequest
createDoc "Bar.watch" "haskell" ""
loggingNotification -- initialized log message
- createDoc "register.abs" "haskell" ""
+ createDoc ".register.abs" "haskell" ""
message :: Session RegisterCapabilityRequest
doc <- createDoc (curDir </> "Foo.watch") "haskell" ""
liftIO $ msg ^. params . LSP.message `shouldBe` "got workspace/didChangeWatchedFiles"
-- now unregister it by sending a specific createDoc
- createDoc "unregister.abs" "haskell" ""
+ createDoc ".unregister.abs" "haskell" ""
message :: Session UnregisterCapabilityRequest
createDoc (curDir </> "Bar.watch") "haskell" ""