Implementation of JSON-RPC 2.0 (https://www.jsonrpc.org/specification) for use in the LSP server.
- str: String → Lean.JsonRpc.RequestID
- num: Lean.JsonNumber → Lean.JsonRpc.RequestID
- null: Lean.JsonRpc.RequestID
In JSON-RPC, each request from the client editor to the language server comes with a request id so that the corresponding response can be identified or cancelled.
Instances For
Equations
- Lean.JsonRpc.instInhabitedRequestID = { default := Lean.JsonRpc.RequestID.str default }
Equations
Equations
- Lean.JsonRpc.instOrdRequestID = { compare := Lean.JsonRpc.ordRequestID✝ }
Equations
- Lean.JsonRpc.instOfNatRequestID = { ofNat := Lean.JsonRpc.RequestID.num (Lean.JsonNumber.fromNat n) }
Equations
- One or more equations did not get rendered due to their size.
- parseError: Lean.JsonRpc.ErrorCode
Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
- invalidRequest: Lean.JsonRpc.ErrorCode
The JSON sent is not a valid Request object.
- methodNotFound: Lean.JsonRpc.ErrorCode
The method does not exist / is not available.
- invalidParams: Lean.JsonRpc.ErrorCode
Invalid method parameter(s).
- internalError: Lean.JsonRpc.ErrorCode
Internal JSON-RPC error.
- serverNotInitialized: Lean.JsonRpc.ErrorCode
Error code indicating that a server received a notification or request before the server has received the
initialize
request. - unknownErrorCode: Lean.JsonRpc.ErrorCode
- contentModified: Lean.JsonRpc.ErrorCode
The server detected that the content of a document got modified outside normal conditions. A server should NOT send this error code if it detects a content change in it unprocessed messages. The result even computed on an older state might still be useful for the client.
If a client decides that a result is not of any use anymore the client should cancel the request.
- requestCancelled: Lean.JsonRpc.ErrorCode
The client has canceled a request and a server as detected the cancel.
- rpcNeedsReconnect: Lean.JsonRpc.ErrorCode
- workerExited: Lean.JsonRpc.ErrorCode
- workerCrashed: Lean.JsonRpc.ErrorCode
Error codes defined by JSON-RPC and LSP.
Instances For
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
- request: Lean.JsonRpc.RequestID → String → Option Lean.Json.Structured → Lean.JsonRpc.Message
A request message to describe a request between the client and the server. Every processed request must send a response back to the sender of the request.
- notification: String → Option Lean.Json.Structured → Lean.JsonRpc.Message
A notification message. A processed notification message must not send a response back. They work like events.
- response: Lean.JsonRpc.RequestID → Lean.Json → Lean.JsonRpc.Message
A Response Message sent as a result of a request.
- responseError: Lean.JsonRpc.RequestID → Lean.JsonRpc.ErrorCode → String → Option Lean.Json → Lean.JsonRpc.Message
A non-successful response.
A JSON-RPC message.
Uses separate constructors for notifications and errors because client and server behavior is expected to be wildly different for both.
Instances For
Equations
Instances For
- method : String
- param : α
Generic version of Message.request
.
A request message to describe a request between the client and the server. Every processed request must send a response back to the sender of the request.
Instances For
Equations
- Lean.JsonRpc.instInhabitedRequest = { default := { id := default, method := default, param := default } }
Equations
- Lean.JsonRpc.instBEqRequest = { beq := Lean.JsonRpc.beqRequest✝ }
Equations
- Lean.JsonRpc.instCoeOutRequestMessage = { coe := fun r => Lean.JsonRpc.Message.request r.id r.method (Except.toOption (Lean.Json.toStructured? r.param)) }
- method : String
- param : α
Generic version of Message.notification
.
A notification message. A processed notification message must not send a response back. They work like events.
Instances For
Equations
- Lean.JsonRpc.instInhabitedNotification = { default := { method := default, param := default } }
Equations
- Lean.JsonRpc.instBEqNotification = { beq := Lean.JsonRpc.beqNotification✝ }
Equations
- Lean.JsonRpc.instCoeOutNotificationMessage = { coe := fun r => Lean.JsonRpc.Message.notification r.method (Except.toOption (Lean.Json.toStructured? r.param)) }
- result : α
Generic version of Message.response
.
A Response Message sent as a result of a request. If a request doesn’t provide a result value the receiver of a request still needs to return a response message to conform to the JSON-RPC specification. The result property of the ResponseMessage should be set to null in this case to signal a successful request.
References:
Instances For
Equations
- Lean.JsonRpc.instInhabitedResponse = { default := { id := default, result := default } }
Equations
- Lean.JsonRpc.instBEqResponse = { beq := Lean.JsonRpc.beqResponse✝ }
Equations
- Lean.JsonRpc.instCoeOutResponseMessage = { coe := fun r => Lean.JsonRpc.Message.response r.id (Lean.toJson r.result) }
- code : Lean.JsonRpc.ErrorCode
- message : String
A string providing a short description of the error.
- data? : Option α
A primitive or structured value that contains additional information about the error. Can be omitted.
Generic version of Message.responseError
.
References:
Instances For
Equations
- Lean.JsonRpc.instInhabitedResponseError = { default := { id := default, code := default, message := default, data? := default } }
Equations
- Lean.JsonRpc.instBEqResponseError = { beq := Lean.JsonRpc.beqResponseError✝ }
Equations
- Lean.JsonRpc.instCoeOutResponseErrorMessage = { coe := fun r => Lean.JsonRpc.Message.responseError r.id r.code r.message (Option.map Lean.toJson r.data?) }
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- IO.FS.Stream.writeRequest h r = IO.FS.Stream.writeMessage h (Lean.JsonRpc.Message.request r.id r.method (Except.toOption (Lean.Json.toStructured? r.param)))
Instances For
Equations
- IO.FS.Stream.writeNotification h n = IO.FS.Stream.writeMessage h (Lean.JsonRpc.Message.notification n.method (Except.toOption (Lean.Json.toStructured? n.param)))
Instances For
Equations
- IO.FS.Stream.writeResponse h r = IO.FS.Stream.writeMessage h (Lean.JsonRpc.Message.response r.id (Lean.toJson r.result))
Instances For
Equations
- IO.FS.Stream.writeResponseError h e = IO.FS.Stream.writeMessage h (Lean.JsonRpc.Message.responseError e.id e.code e.message none)
Instances For
Equations
- IO.FS.Stream.writeResponseErrorWithData h e = IO.FS.Stream.writeMessage h (Lean.JsonRpc.Message.responseError e.id e.code e.message (Option.map Lean.toJson e.data?))