Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion ocaml-lsp-server/src/ocaml_lsp_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,22 @@ let on_request :
| TextDocumentDeclaration { textDocument = { uri }; position } ->
later (fun state () -> definition_query `Declaration state uri position) ()
| TextDocumentDefinition { textDocument = { uri }; position; _ } ->
later (fun state () -> definition_query `Definition state uri position) ()
let doc =
Document_store.change_document store uri ~f:(fun doc ->
(* we need [update_text] with no changes to get a new merlin pipeline;
otherwise the diagnostics don't get updated *)
Document.update_text doc [])
in
let+ (), state =
Fiber.fork_and_join
(fun (* TODO: should we really be updating the diagnostics here? *)
() -> set_diagnostics state.detached state.diagnostics doc)
(fun () ->
later
(fun state () -> definition_query `Definition state uri position)
())
in
state
| TextDocumentTypeDefinition { textDocument = { uri }; position; _ } ->
later
(fun state () -> definition_query `Type_definition state uri position)
Expand Down