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
Equations
- Lean.JsonRpc.instInhabitedRequestID = { default := Lean.JsonRpc.RequestID.str default }
Equations
- Lean.JsonRpc.instBEqRequestID = { beq := [anonymous] }
Equations
- Lean.JsonRpc.instOrdRequestID = { compare := [anonymous] }
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
- invalidRequest: Lean.JsonRpc.ErrorCode
- methodNotFound: Lean.JsonRpc.ErrorCode
- invalidParams: Lean.JsonRpc.ErrorCode
- internalError: Lean.JsonRpc.ErrorCode
- serverNotInitialized: Lean.JsonRpc.ErrorCode
- unknownErrorCode: Lean.JsonRpc.ErrorCode
- contentModified: Lean.JsonRpc.ErrorCode
- requestCancelled: Lean.JsonRpc.ErrorCode
- rpcNeedsReconnect: Lean.JsonRpc.ErrorCode
- workerExited: Lean.JsonRpc.ErrorCode
- workerCrashed: Lean.JsonRpc.ErrorCode
Error codes defined by JSON-RPC and LSP.
Equations
Equations
- Lean.JsonRpc.instBEqErrorCode = { beq := [anonymous] }
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
- notification: String → Option Lean.Json.Structured → Lean.JsonRpc.Message
- response: Lean.JsonRpc.RequestID → Lean.Json → Lean.JsonRpc.Message
- responseError: Lean.JsonRpc.RequestID → Lean.JsonRpc.ErrorCode → String → Option Lean.Json → Lean.JsonRpc.Message
- method : String
- param : α
instance
Lean.JsonRpc.instInhabitedRequest:
{a : Type u_1} → [inst : Inhabited a] → Inhabited (Lean.JsonRpc.Request a)
Equations
- Lean.JsonRpc.instInhabitedRequest = { default := { id := default, method := default, param := default } }
Equations
- Lean.JsonRpc.instBEqRequest = { beq := [anonymous] }
Equations
- Lean.JsonRpc.instCoeRequestMessage = { coe := fun r => Lean.JsonRpc.Message.request r.id r.method (Except.toOption (Lean.Json.toStructured? r.param)) }
instance
Lean.JsonRpc.instInhabitedNotification:
{a : Type u_1} → [inst : Inhabited a] → Inhabited (Lean.JsonRpc.Notification a)
Equations
- Lean.JsonRpc.instInhabitedNotification = { default := { method := default, param := default } }
instance
Lean.JsonRpc.instBEqNotification:
{α : Type u_1} → [inst : BEq α] → BEq (Lean.JsonRpc.Notification α)
Equations
- Lean.JsonRpc.instBEqNotification = { beq := [anonymous] }
Equations
- Lean.JsonRpc.instCoeNotificationMessage = { coe := fun r => Lean.JsonRpc.Message.notification r.method (Except.toOption (Lean.Json.toStructured? r.param)) }
instance
Lean.JsonRpc.instInhabitedResponse:
{a : Type u_1} → [inst : Inhabited a] → Inhabited (Lean.JsonRpc.Response a)
Equations
- Lean.JsonRpc.instInhabitedResponse = { default := { id := default, result := default } }
instance
Lean.JsonRpc.instBEqResponse:
{α : Type u_1} → [inst : BEq α] → BEq (Lean.JsonRpc.Response α)
Equations
- Lean.JsonRpc.instBEqResponse = { beq := [anonymous] }
Equations
- Lean.JsonRpc.instCoeResponseMessage = { coe := fun r => Lean.JsonRpc.Message.response r.id (Lean.toJson r.result) }
- code : Lean.JsonRpc.ErrorCode
- message : String
- data? : Option α
instance
Lean.JsonRpc.instInhabitedResponseError:
{a : Type u_1} → Inhabited (Lean.JsonRpc.ResponseError a)
Equations
- Lean.JsonRpc.instInhabitedResponseError = { default := { id := default, code := default, message := default, data? := default } }
instance
Lean.JsonRpc.instBEqResponseError:
{α : Type u_1} → [inst : BEq α] → BEq (Lean.JsonRpc.ResponseError α)
Equations
- Lean.JsonRpc.instBEqResponseError = { beq := [anonymous] }
Equations
- Lean.JsonRpc.instCoeResponseErrorMessage = { coe := fun r => Lean.JsonRpc.Message.responseError r.id r.code r.message (Option.map Lean.toJson r.data?) }
Equations
instance
Lean.JsonRpc.instDecidableLtRequestIDInstLTRequestID
(a : Lean.JsonRpc.RequestID)
(b : Lean.JsonRpc.RequestID)
:
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.
def
IO.FS.Stream.readRequestAs
(h : IO.FS.Stream)
(nBytes : Nat)
(expectedMethod : String)
(α : Type)
[inst : Lean.FromJson α]
:
Equations
- One or more equations did not get rendered due to their size.
def
IO.FS.Stream.readNotificationAs
(h : IO.FS.Stream)
(nBytes : Nat)
(expectedMethod : String)
(α : Type)
[inst : Lean.FromJson α]
:
Equations
- One or more equations did not get rendered due to their size.
partial def
IO.FS.Stream.readResponseAs
(h : IO.FS.Stream)
(nBytes : Nat)
(expectedID : Lean.JsonRpc.RequestID)
(α : Type)
[inst : Lean.FromJson α]
:
Equations
def
IO.FS.Stream.writeRequest
{α : Type u_1}
[inst : Lean.ToJson α]
(h : IO.FS.Stream)
(r : Lean.JsonRpc.Request α)
:
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)))
def
IO.FS.Stream.writeNotification
{α : Type u_1}
[inst : Lean.ToJson α]
(h : IO.FS.Stream)
(n : Lean.JsonRpc.Notification α)
:
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)))
def
IO.FS.Stream.writeResponse
{α : Type u_1}
[inst : Lean.ToJson α]
(h : IO.FS.Stream)
(r : Lean.JsonRpc.Response α)
:
Equations
- IO.FS.Stream.writeResponse h r = IO.FS.Stream.writeMessage h (Lean.JsonRpc.Message.response r.id (Lean.toJson r.result))
Equations
- IO.FS.Stream.writeResponseError h e = IO.FS.Stream.writeMessage h (Lean.JsonRpc.Message.responseError e.id e.code e.message none)
def
IO.FS.Stream.writeResponseErrorWithData
{α : Type u_1}
[inst : Lean.ToJson α]
(h : IO.FS.Stream)
(e : Lean.JsonRpc.ResponseError α)
:
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?))