Skip to content

Commit

Permalink
Add handler for 'documentDidClose'
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrykeWindgrace committed Oct 27, 2024
1 parent 8c3f657 commit b007349
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dhall-lsp-server/src/Dhall/LSP/Handlers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,11 @@ cancelationHandler :: Handlers HandlerM
cancelationHandler =
LSP.notificationHandler SMethod_CancelRequest \_ -> return ()

-- this handler is a stab 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
Expand Down
2 changes: 2 additions & 0 deletions dhall-lsp-server/src/Dhall/LSP/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import Dhall.LSP.Handlers
, workspaceChangeConfigurationHandler
, textDocumentChangeHandler
, cancelationHandler
, documentDidCloseHandler
)
import Dhall.LSP.State
import Language.LSP.Server (LspServerLog, Options(..), ServerDefinition(..), type (<~>)(..))
Expand Down Expand Up @@ -92,6 +93,7 @@ run = withLogger $ \ioLogger -> do
, workspaceChangeConfigurationHandler
, textDocumentChangeHandler
, cancelationHandler
, documentDidCloseHandler
]

let interpretHandler environment = Iso{..}
Expand Down

0 comments on commit b007349

Please sign in to comment.