This file contains Lean-specific extensions to LSP. See the structures below for which additional requests and notifications are supported.
- uri : Lean.Lsp.DocumentUri
- version : Nat
textDocument/waitForDiagnostics
client->server request.
Yields a response when all the diagnostics for a version of the document greater or equal to the specified one have been emitted. If the request specifies a version above the most recently processed one, the server will delay the response until it does receive the specified version. Exists for synchronization purposes, e.g. during testing or when external tools might want to use our LSP server.
Equations
- Lean.Lsp.instFromJsonWaitForDiagnosticsParams = { fromJson? := [anonymous] }
textDocument/waitForDiagnostics
client<-server reply.
Equations
- Lean.Lsp.instFromJsonWaitForDiagnostics = { fromJson? := fun x => pure { } }
Equations
- Lean.Lsp.instToJsonWaitForDiagnostics = { toJson := fun x => Lean.Json.mkObj [] }
- processing: Lean.Lsp.LeanFileProgressKind
- fatalError: Lean.Lsp.LeanFileProgressKind
Equations
- Lean.Lsp.instBEqLeanFileProgressKind = { beq := [anonymous] }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Lsp.instToJsonLeanFileProgressKind = { toJson := fun x => match x with | Lean.Lsp.LeanFileProgressKind.processing => 1 | Lean.Lsp.LeanFileProgressKind.fatalError => 2 }
- range : Lean.Lsp.Range
- textDocument : Lean.Lsp.VersionedTextDocumentIdentifier
- processing : Array Lean.Lsp.LeanFileProgressProcessingInfo
$/lean/fileProgress
client<-server notification.
Contains the ranges of the document that are currently being processed by the server.
Equations
- Lean.Lsp.instFromJsonLeanFileProgressParams = { fromJson? := [anonymous] }
Equations
- Lean.Lsp.instToJsonLeanFileProgressParams = { toJson := [anonymous] }
$/lean/plainGoal
client->server request.
If there is a tactic proof at the specified position, returns the current goals.
Otherwise returns null
.
Equations
- Lean.Lsp.instFromJsonPlainGoalParams = { fromJson? := [anonymous] }
Equations
- Lean.Lsp.instToJsonPlainGoalParams = { toJson := [anonymous] }
The goals as pretty-printed Markdown, or something like "no goals" if accomplished.
rendered : StringThe pretty-printed goals, empty if all accomplished.
$/lean/plainGoal
client<-server reply.
Equations
- Lean.Lsp.instFromJsonPlainGoal = { fromJson? := [anonymous] }
Equations
- Lean.Lsp.instToJsonPlainGoal = { toJson := [anonymous] }
$/lean/plainTermGoal
client->server request.
Returns the expected type at the specified position, pretty-printed as a string.
Equations
- Lean.Lsp.instFromJsonPlainTermGoalParams = { fromJson? := [anonymous] }
Equations
- Lean.Lsp.instToJsonPlainTermGoalParams = { toJson := [anonymous] }
- goal : String
- range : Lean.Lsp.Range
$/lean/plainTermGoal
client<-server reply.
Equations
- Lean.Lsp.instFromJsonPlainTermGoal = { fromJson? := [anonymous] }
Equations
- Lean.Lsp.instToJsonPlainTermGoal = { toJson := [anonymous] }
- p : USize
An object which RPC clients can refer to without marshalling.
Equations
- Lean.Lsp.instBEqRpcRef = { beq := [anonymous] }
Equations
- Lean.Lsp.instHashableRpcRef = { hash := [anonymous] }
Equations
- Lean.Lsp.instFromJsonRpcRef = { fromJson? := [anonymous] }
Equations
- Lean.Lsp.instToJsonRpcRef = { toJson := [anonymous] }
Equations
- Lean.Lsp.instToStringRpcRef = { toString := fun r => toString r.p }
- uri : Lean.Lsp.DocumentUri
$/lean/rpc/connect
client->server request.
Starts an RPC session at the given file's worker, replying with the new session ID. Multiple sessions may be started and operating concurrently.
A session may be destroyed by the server at any time (e.g. due to a crash), in which case further
RPC requests for that session will reply with RpcNeedsReconnect
errors. The client should discard
references held from that session and connect
again.
Equations
- Lean.Lsp.instFromJsonRpcConnectParams = { fromJson? := [anonymous] }
Equations
- Lean.Lsp.instToJsonRpcConnectParams = { toJson := [anonymous] }
- sessionId : UInt64
$/lean/rpc/connect
client<-server reply.
Indicates that an RPC connection had been made and a session started for it.
Equations
- Lean.Lsp.instFromJsonRpcConnected = { fromJson? := [anonymous] }
Equations
- Lean.Lsp.instToJsonRpcConnected = { toJson := [anonymous] }
$/lean/rpc/call
client->server request.
A request to execute a procedure bound for RPC. If an incorrect session ID is present, the server
errors with RpcNeedsReconnect
.
Extending TDPP is weird. But in Lean, symbols exist in the context of a position within a source file. So we need this to refer to code in the environment at that position.
Equations
- Lean.Lsp.instFromJsonRpcCallParams = { fromJson? := [anonymous] }
Equations
- Lean.Lsp.instToJsonRpcCallParams = { toJson := [anonymous] }
- uri : Lean.Lsp.DocumentUri
- sessionId : UInt64
- refs : Array Lean.Lsp.RpcRef
$/lean/rpc/release
client->server notification.
A notification to release remote references. Should be sent by the client when it no longer needs
RpcRef
s it has previously received from the server. Not doing so is safe but will leak memory.
Equations
- Lean.Lsp.instFromJsonRpcReleaseParams = { fromJson? := [anonymous] }
Equations
- Lean.Lsp.instToJsonRpcReleaseParams = { toJson := [anonymous] }
- uri : Lean.Lsp.DocumentUri
- sessionId : UInt64
$/lean/rpc/keepAlive
client->server notification.
The client must send an RPC notification every 10s in order to keep the RPC session alive. This is the simplest one. On not seeing any notifications for three 10s periods, the server will drop the RPC session and its associated references.
Equations
- Lean.Lsp.instFromJsonRpcKeepAliveParams = { fromJson? := [anonymous] }
Equations
- Lean.Lsp.instToJsonRpcKeepAliveParams = { toJson := [anonymous] }
Range of lines in a document, including start
but excluding end
.
Equations
- Lean.Lsp.instInhabitedLineRange = { default := { start := default, end := default } }
Equations
- Lean.Lsp.instReprLineRange = { reprPrec := [anonymous] }
Equations
- Lean.Lsp.instFromJsonLineRange = { fromJson? := [anonymous] }
Equations
- Lean.Lsp.instToJsonLineRange = { toJson := [anonymous] }