Try to make dummy server platform agnostic
authorLuke Lau <luke_lau@icloud.com>
Thu, 14 May 2020 19:51:09 +0000 (20:51 +0100)
committerLuke Lau <luke_lau@icloud.com>
Thu, 14 May 2020 19:51:09 +0000 (20:51 +0100)
test/Test.hs
test/dummy-server/Main.hs

index fe599e7448a07031c9ce37e252faffa86e01bb2c..c4aae07303337e44dbfa89d89040edebc073b96a 100644 (file)
@@ -333,7 +333,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 +348,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 +361,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 +369,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" ""
index 8120b030431c1bb0ce6b977f7a750755bb9dabda..aa73677eb061e8be697723286469b36692d20d1d 100644 (file)
@@ -59,7 +59,7 @@ handlers lfvar = def
           fmServerPublishDiagnosticsNotification $ PublishDiagnosticsParams uri $ List [diag]
 
       -- also act as a registerer for workspace/didChangeWatchedFiles
-      when ("/register" `isSuffixOf` fp) $ do
+      when (".register" `isSuffixOf` fp) $ do
         reqId <- readMVar lfvar >>= getNextReqId
         send $ ReqRegisterCapability $ fmServerRegisterCapabilityRequest reqId $
           RegistrationParams $ List $
@@ -67,7 +67,7 @@ handlers lfvar = def
                 DidChangeWatchedFilesRegistrationOptions $ List
                 [ FileSystemWatcher "*.watch" (Just (WatchKind True True True)) ]
             ]
-      when ("/register.abs" `isSuffixOf` fp) $ do
+      when (".register.abs" `isSuffixOf` fp) $ do
         curDir <- getCurrentDirectory
         reqId <- readMVar lfvar >>= getNextReqId
         send $ ReqRegisterCapability $ fmServerRegisterCapabilityRequest reqId $
@@ -78,11 +78,11 @@ handlers lfvar = def
             ]
 
       -- also act as an unregisterer for workspace/didChangeWatchedFiles
-      when ("/unregister" `isSuffixOf` fp) $ do
+      when (".unregister" `isSuffixOf` fp) $ do
         reqId <- readMVar lfvar >>= getNextReqId
         send $ ReqUnregisterCapability $ fmServerUnregisterCapabilityRequest reqId $
           UnregistrationParams $ List [ Unregistration "0" "workspace/didChangeWatchedFiles" ]
-      when ("/unregister.abs" `isSuffixOf` fp) $ do
+      when (".unregister.abs" `isSuffixOf` fp) $ do
         reqId <- readMVar lfvar >>= getNextReqId
         send $ ReqUnregisterCapability $ fmServerUnregisterCapabilityRequest reqId $
           UnregistrationParams $ List [ Unregistration "1" "workspace/didChangeWatchedFiles" ]