- code : Lean.JsonRpc.ErrorCode
- message : String
Instances For
Equations
- Lean.Server.instInhabitedRequestError = { default := { code := default, message := default } }
Equations
- Lean.Server.RequestError.fileChanged = { code := Lean.JsonRpc.ErrorCode.contentModified, message := "File changed." }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Server.RequestError.invalidParams message = { code := Lean.JsonRpc.ErrorCode.invalidParams, message := message }
Instances For
Equations
- Lean.Server.RequestError.internalError message = { code := Lean.JsonRpc.ErrorCode.internalError, message := message }
Instances For
Equations
- Lean.Server.RequestError.ofException e = do let __do_lift ← Lean.MessageData.toString (Lean.Exception.toMessageData e) pure (Lean.Server.RequestError.internalError __do_lift)
Instances For
Instances For
Equations
- Lean.Server.RequestError.toLspResponseError id e = { id := id, code := e.code, message := e.message, data? := none }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- rpcSessions : Lean.RBMap UInt64 (IO.Ref Lean.Server.FileWorker.RpcSession) compare
- srcSearchPath : Lean.SearchPath
- hLog : IO.FS.Stream
- hOut : IO.FS.Stream
- initParams : Lean.Lsp.InitializeParams
Instances For
Equations
Instances For
Equations
Instances For
Workers execute request handlers in this monad.
Instances For
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
- Lean.Server.RequestM.readDoc = do let rc ← readThe Lean.Server.RequestContext pure rc.doc
Instances For
Equations
- Lean.Server.RequestM.asTask t = do let rc ← readThe Lean.Server.RequestContext let t ← liftM (EIO.asTask (ReaderT.run t rc) Task.Priority.default) pure (Task.map liftExcept t)
Instances For
Equations
- Lean.Server.RequestM.mapTask t f = do let rc ← readThe Lean.Server.RequestContext let t ← liftM (EIO.mapTask (fun x => f x rc) t Task.Priority.default) pure (Task.map liftExcept t)
Instances For
Equations
- Lean.Server.RequestM.bindTask t f = do let rc ← readThe Lean.Server.RequestContext liftM (EIO.bindTask t (fun x => f x rc) Task.Priority.default)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Create a task which waits for the first snapshot matching p
, handles various errors,
and if a matching snapshot was found executes x
with it. If not found, the task executes
notFoundX
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
See withWaitFindSnap
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Create a task which waits for the snapshot containing lspPos
and executes f
with it.
If no such snapshot exists, the request fails with an error.
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
- One or more equations did not get rendered due to their size.
Instances For
The global request handlers table #
We maintain a global map of LSP request handlers. This allows user code such as plugins to register its own handlers, for example to support ITP functionality such as goal state visualization.
For details of how to register one, see registerLspRequestHandler
.
- fileSource : Lean.Json → Except Lean.Server.RequestError Lean.Lsp.DocumentUri
- handle : Lean.Json → Lean.Server.RequestM (Lean.Server.RequestTask Lean.Json)
Instances For
NB: This method may only be called in initialize
blocks (user or builtin).
A registration consists of:
- a type of JSON-parsable request data
paramType
- a
FileSource
instance for it so the system knows where to route requests - a type of JSON-serializable response data
respType
- an actual
handler
which runs in theRequestM
monad and is expected to produce an asynchronousRequestTask
which does any waiting/computation
A handler task may be cancelled at any time, so it should check the cancellation token when possible to handle this cooperatively. Any exceptions thrown in a request handler will be reported to the client as LSP error responses.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Server.lookupLspRequestHandler method = do let __do_lift ← ST.Ref.get Lean.Server.requestHandlers pure (Lean.PersistentHashMap.find? __do_lift method)
Instances For
NB: This method may only be called in initialize
blocks (user or builtin).
Register another handler to invoke after the last one registered for a method. At least one handler for the method must have already been registered to perform chaining.
For more details on the registration of a handler, see registerLspRequestHandler
.
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.