Skip to content

Commit

Permalink
Apparently we still need dummy versions of this or Eglot will complain.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed Dec 5, 2023
1 parent 3899e97 commit 6dc51c3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Futhark/LSP/Handlers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ onDocumentChangeHandler state_mvar =
file_path = uriToFilePath $ doc ^. uri
tryReCompile state_mvar file_path

-- Some clients (Eglot) sends open/close events whether we want them
-- or not, so we better be prepared to ignore them.
onDocumentOpenHandler :: Handlers (LspM ())
onDocumentOpenHandler = notificationHandler SMethod_TextDocumentDidOpen $ \_ -> pure ()

onDocumentCloseHandler :: Handlers (LspM ())
onDocumentCloseHandler = notificationHandler SMethod_TextDocumentDidClose $ \_msg -> pure ()

-- Sent by Eglot when first connecting - not sure when else it might
-- be sent.
onWorkspaceDidChangeConfiguration :: IORef State -> Handlers (LspM ())
Expand All @@ -80,6 +88,8 @@ handlers :: IORef State -> ClientCapabilities -> Handlers (LspM ())
handlers state_mvar _ =
mconcat
[ onInitializeHandler,
onDocumentOpenHandler,
onDocumentCloseHandler,
onDocumentSaveHandler state_mvar,
onDocumentChangeHandler state_mvar,
onDocumentFocusHandler state_mvar,
Expand Down

0 comments on commit 6dc51c3

Please sign in to comment.