-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize code actions and custom requests into subdirs
- Loading branch information
Showing
11 changed files
with
88 additions
and
83 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
29 changes: 29 additions & 0 deletions
29
ocaml-lsp-server/src/custom_requests/req_switch_impl_intf.ml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
open Import | ||
|
||
let capability = ("handleSwitchImplIntf", `Bool true) | ||
|
||
let meth = "ocamllsp/switchImplIntf" | ||
|
||
(** see the spec for [ocamllsp/switchImplIntf] *) | ||
let switch (param : DocumentUri.t) : (Json.t, Jsonrpc.Response.Error.t) result = | ||
let files_to_switch_to = | ||
Document.get_impl_intf_counterparts (Uri.t_of_yojson (`String param)) | ||
in | ||
Ok | ||
(Json.yojson_of_list | ||
(fun uri -> uri |> Uri.to_string |> fun s -> `String s) | ||
files_to_switch_to) | ||
|
||
let on_request ~(params : Json.t option) state = | ||
Fiber.return | ||
( match params with | ||
| Some (`String (file_uri : DocumentUri.t)) -> | ||
let open Result.O in | ||
let+ res = switch file_uri in | ||
(res, state) | ||
| Some _ | ||
| None -> | ||
Error | ||
(Jsonrpc.Response.Error.make ~code:InvalidRequest | ||
~message:"ocamllsp/switchImplIntf must receive param : DocumentUri.t" | ||
()) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.