respond to progress create and apply edit
authorZubin Duggal <zubin@cmi.ac.in>
Tue, 9 Feb 2021 14:29:53 +0000 (19:59 +0530)
committerZubin Duggal <zubin@cmi.ac.in>
Tue, 9 Feb 2021 14:29:53 +0000 (19:59 +0530)
src/Language/LSP/Test/Session.hs

index 4e3b1777298c78e4024f526aa37b36de3a56bacf..4b3ce84be89205dbd1637a382ec3e61f19295a25 100644 (file)
@@ -309,6 +309,8 @@ documentChangeUri (InR (InR (InR x))) = x ^. uri
 
 updateState :: (MonadIO m, HasReader SessionContext m, HasState SessionState m)
             => FromServerMessage -> m ()
+updateState (FromServerMess SWindowWorkDoneProgressCreate req) =
+  sendMessage $ ResponseMessage "2.0" (Just $ req ^. LSP.id) (Right ())
 updateState (FromServerMess SProgress req) = case req ^. params . value of
   Begin _ ->
     modify $ \s -> s { curProgressSessions = Set.insert (req ^. params . token) $ curProgressSessions s }
@@ -360,6 +362,8 @@ updateState (FromServerMess SWorkspaceApplyEdit r) = do
   -- TODO: Don't do this when replaying a session
   forM_ mergedParams (sendMessage . NotificationMessage "2.0" STextDocumentDidChange)
 
+  sendMessage $ ResponseMessage "2.0" (Just $ r ^. LSP.id) (Right $ ApplyWorkspaceEditResponseBody True Nothing)
+
   -- Update VFS to new document versions
   let sortedVersions = map (sortBy (compare `on` (^. textDocument . version))) groupedParams
       latestVersions = map ((^. textDocument) . last) sortedVersions