X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=test%2FTest.hs;h=7b911f4e585a92809b4f4488f3252770ea8fdb2b;hb=72257c6a7b5461c529c415b93e1c3507e1c843a7;hp=fe599e7448a07031c9ce37e252faffa86e01bb2c;hpb=71f5ececdaa02c87b026c40d70fb55c4a0d05044;p=lsp-test.git diff --git a/test/Test.hs b/test/Test.hs index fe599e7..7b911f4 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -221,21 +221,13 @@ main = findServer >>= \serverExe -> hspec $ do 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 @@ -333,7 +325,7 @@ main = findServer >>= \serverExe -> hspec $ 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" "" @@ -348,7 +340,7 @@ main = findServer >>= \serverExe -> hspec $ do ] -- now unregister it by sending a specific createDoc - createDoc "unregister" "haskell" "" + createDoc ".unregister" "haskell" "" message :: Session UnregisterCapabilityRequest createDoc "Bar.watch" "haskell" "" @@ -361,7 +353,7 @@ main = findServer >>= \serverExe -> hspec $ do loggingNotification -- initialized log message - createDoc "register.abs" "haskell" "" + createDoc ".register.abs" "haskell" "" message :: Session RegisterCapabilityRequest doc <- createDoc (curDir "Foo.watch") "haskell" "" @@ -369,7 +361,7 @@ main = findServer >>= \serverExe -> hspec $ do 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" ""