X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=test%2Fdummy-server%2FMain.hs;h=ab917e8fa50ff825b35b996f78fd94fb80ad96b6;hb=72257c6a7b5461c529c415b93e1c3507e1c843a7;hp=8120b030431c1bb0ce6b977f7a750755bb9dabda;hpb=71f5ececdaa02c87b026c40d70fb55c4a0d05044;p=lsp-test.git diff --git a/test/dummy-server/Main.hs b/test/dummy-server/Main.hs index 8120b03..ab917e8 100644 --- a/test/dummy-server/Main.hs +++ b/test/dummy-server/Main.hs @@ -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" ] @@ -109,6 +109,13 @@ handlers lfvar = def send $ RspCodeAction $ makeResponseMessage req caresults , didChangeWatchedFilesNotificationHandler = pure $ \_ -> send $ NotLogMessage $ fmServerLogMessageNotification MtLog "got workspace/didChangeWatchedFiles" + , completionHandler = pure $ \req -> do + let res = CompletionList (CompletionListType False (List [item])) + item = + CompletionItem "foo" (Just CiConstant) (List []) Nothing + Nothing Nothing Nothing Nothing Nothing Nothing Nothing + Nothing Nothing Nothing Nothing Nothing + send $ RspCompletion $ makeResponseMessage req res } where send msg = readMVar lfvar >>= \lf -> (sendFunc lf) msg