Skip to content

Commit

Permalink
Use Document kind instead of merlin_exn
Browse files Browse the repository at this point in the history
  • Loading branch information
xvw committed Jun 9, 2024
1 parent 2c04293 commit 40046d6
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ let from_structured_json_exn = function
raise_invalid_params ~data ~message:"Unexpected params format" ())

let with_pipeline state uri specs raw_args cmd_args f =
match Document_store.get_opt state.State.store uri with
| Some doc ->
let merlin = Document.merlin_exn doc in
let doc = Document_store.get state.State.store uri in
match Document.kind doc with
| `Other -> Fiber.return `Null
| `Merlin merlin ->
let open Fiber.O in
let* config = Document.Merlin.mconfig merlin in
let specs = List.map ~f:snd specs in
Expand All @@ -136,11 +137,6 @@ let with_pipeline state uri specs raw_args cmd_args f =
cmd_args
in
Document.Merlin.with_configurable_pipeline_exn ~config merlin (f args)
| None ->
let message =
"Document " ^ Uri.to_string uri ^ " wasn't found in the document store"
in
raise_invalid_params ~message ()

let perform_query action params pipeline =
let action () = action pipeline params in
Expand Down

0 comments on commit 40046d6

Please sign in to comment.