diff --git a/dhall-lsp-server/src/Dhall/LSP/Handlers.hs b/dhall-lsp-server/src/Dhall/LSP/Handlers.hs index 547d88b46..178914b76 100644 --- a/dhall-lsp-server/src/Dhall/LSP/Handlers.hs +++ b/dhall-lsp-server/src/Dhall/LSP/Handlers.hs @@ -641,6 +641,11 @@ cancelationHandler :: Handlers HandlerM cancelationHandler = LSP.notificationHandler SMethod_CancelRequest \_ -> return () +-- This handler is a stub to prevent `lsp:no handler for:` messages. +documentDidCloseHandler :: Handlers HandlerM +documentDidCloseHandler = + LSP.notificationHandler SMethod_TextDocumentDidClose \_ -> return () + handleErrorWithDefault :: (Either a1 b -> HandlerM a2) -> b -> HandlerM a2 diff --git a/dhall-lsp-server/src/Dhall/LSP/Server.hs b/dhall-lsp-server/src/Dhall/LSP/Server.hs index de0046a00..36f174a96 100644 --- a/dhall-lsp-server/src/Dhall/LSP/Server.hs +++ b/dhall-lsp-server/src/Dhall/LSP/Server.hs @@ -22,6 +22,7 @@ import Dhall.LSP.Handlers , workspaceChangeConfigurationHandler , textDocumentChangeHandler , cancelationHandler + , documentDidCloseHandler ) import Dhall.LSP.State import Language.LSP.Server (LspServerLog, Options(..), ServerDefinition(..), type (<~>)(..)) @@ -92,6 +93,7 @@ run = withLogger $ \ioLogger -> do , workspaceChangeConfigurationHandler , textDocumentChangeHandler , cancelationHandler + , documentDidCloseHandler ] let interpretHandler environment = Iso{..}