Skip to content

Commit d1fc29b

Browse files
Add handler for 'documentDidClose' (#2613)
* Add handler for 'documentDidClose' * Update dhall-lsp-server/src/Dhall/LSP/Handlers.hs --------- Co-authored-by: Mann mit Hut <mmhat@users.noreply.github.com>
1 parent 8c3f657 commit d1fc29b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

dhall-lsp-server/src/Dhall/LSP/Handlers.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,11 @@ cancelationHandler :: Handlers HandlerM
641641
cancelationHandler =
642642
LSP.notificationHandler SMethod_CancelRequest \_ -> return ()
643643

644+
-- This handler is a stub to prevent `lsp:no handler for:` messages.
645+
documentDidCloseHandler :: Handlers HandlerM
646+
documentDidCloseHandler =
647+
LSP.notificationHandler SMethod_TextDocumentDidClose \_ -> return ()
648+
644649
handleErrorWithDefault :: (Either a1 b -> HandlerM a2)
645650
-> b
646651
-> HandlerM a2

dhall-lsp-server/src/Dhall/LSP/Server.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import Dhall.LSP.Handlers
2222
, workspaceChangeConfigurationHandler
2323
, textDocumentChangeHandler
2424
, cancelationHandler
25+
, documentDidCloseHandler
2526
)
2627
import Dhall.LSP.State
2728
import Language.LSP.Server (LspServerLog, Options(..), ServerDefinition(..), type (<~>)(..))
@@ -92,6 +93,7 @@ run = withLogger $ \ioLogger -> do
9293
, workspaceChangeConfigurationHandler
9394
, textDocumentChangeHandler
9495
, cancelationHandler
96+
, documentDidCloseHandler
9597
]
9698

9799
let interpretHandler environment = Iso{..}

0 commit comments

Comments
 (0)