diff --git a/jsonrpc/src/jsonrpc.ml b/jsonrpc/src/jsonrpc.ml index 5b19a8abe..ab8c3d193 100644 --- a/jsonrpc/src/jsonrpc.ml +++ b/jsonrpc/src/jsonrpc.ml @@ -124,12 +124,15 @@ module Response = struct | MethodNotFound | InvalidParams | InternalError + (* the codes below are LSP specific *) | ServerErrorStart | ServerErrorEnd | ServerNotInitialized | UnknownErrorCode - | RequestCancelled + | RequestFailed + | ServerCancelled | ContentModified + | RequestCancelled let of_int = function | -32700 -> Some ParseError @@ -143,6 +146,8 @@ module Response = struct | -32001 -> Some UnknownErrorCode | -32800 -> Some RequestCancelled | -32801 -> Some ContentModified + | -32802 -> Some ServerCancelled + | -32803 -> Some RequestFailed | _ -> None let to_int = function @@ -157,6 +162,8 @@ module Response = struct | UnknownErrorCode -> -32001 | RequestCancelled -> -32800 | ContentModified -> -32801 + | ServerCancelled -> -32802 + | RequestFailed -> -32803 let t_of_yojson json = match json with diff --git a/jsonrpc/src/jsonrpc.mli b/jsonrpc/src/jsonrpc.mli index 3aecd54ed..b54f89e1b 100644 --- a/jsonrpc/src/jsonrpc.mli +++ b/jsonrpc/src/jsonrpc.mli @@ -92,8 +92,10 @@ module Response : sig | ServerErrorEnd | ServerNotInitialized | UnknownErrorCode - | RequestCancelled + | RequestFailed + | ServerCancelled | ContentModified + | RequestCancelled end type t =