Chains two streams by creating a new stream s.t. writing to it
just writes to a
but reading from it also duplicates the read output
into b
, c.f. a | tee b
on Unix.
NB: if a
is written to but this stream is never read from,
the output will not be duplicated. Use this if you only care
about the data that was actually read.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Like tee a | b
on Unix. See chainOut
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Prefixes all written outputs with pre
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Meta-Data of a document.
- uri : Lean.Lsp.DocumentUri
URI where the document is located.
- version : Nat
Version number of the document. Incremented whenever the document is edited.
- text : Lean.FileMap
Current text of the document. It is maintained such that it is normalized using
String.crlfToLf
, which preserves logical line/column numbers. (Note: we assume that edit operations never split or merge\r\n
line endings.) - dependencyBuildMode : Lean.Lsp.DependencyBuildMode
Controls when dependencies of the document are built on
textDocument/didOpen
notifications.
Instances For
Equations
- Lean.Server.instInhabitedDocumentMeta = { default := { uri := default, version := default, text := default, dependencyBuildMode := default } }
Extracts an InputContext
from doc
.
Equations
- doc.mkInputContext = { input := doc.text.source, fileName := ((System.Uri.fileUriToPath? doc.uri).getD { toString := doc.uri }).toString, fileMap := doc.text }
Instances For
Replaces the range r
(using LSP UTF-16 positions) in text
(using UTF-8 positions)
with newText
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Duplicates an I/O stream to a log file fName
in LEAN_SERVER_LOG_DIR
if that envvar is set.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns the document contents with the change applied.
Equations
- Lean.Server.applyDocumentChange oldText (Lean.Lsp.TextDocumentContentChangeEvent.rangeChange range newText) = Lean.Server.replaceLspRange oldText range newText
- Lean.Server.applyDocumentChange oldText (Lean.Lsp.TextDocumentContentChangeEvent.fullChange newText) = newText.crlfToLf.toFileMap
Instances For
Returns the document contents with all changes applied.
Equations
- Lean.Server.foldDocumentChanges changes oldText = Array.foldl Lean.Server.applyDocumentChange oldText changes
Instances For
Constructs a textDocument/publishDiagnostics
notification.
Equations
- Lean.Server.mkPublishDiagnosticsNotification m diagnostics = { method := "textDocument/publishDiagnostics", param := { uri := m.uri, version? := some ↑m.version, diagnostics := diagnostics } }
Instances For
Constructs a $/lean/fileProgress
notification.
Equations
- Lean.Server.mkFileProgressNotification m processing = { method := "$/lean/fileProgress", param := { textDocument := { uri := m.uri, version? := some m.version }, processing := processing } }
Instances For
Constructs a $/lean/fileProgress
notification from the given position onwards.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Constructs a $/lean/fileProgress
notification marking processing as done.
Equations
Instances For
Equations
- Lean.Server.mkApplyWorkspaceEditRequest params = { id := Lean.JsonRpc.RequestID.str "workspace/applyEdit", method := "workspace/applyEdit", param := params }
Instances For
Converts an UTF-8-based String.range
in text
to an equivalent LSP UTF-16-based Lsp.Range
in text
.
Equations
- String.Range.toLspRange text r = { start := text.utf8PosToLspPos r.start, end := text.utf8PosToLspPos r.stop }
Instances For
Attempts to find a module name in the roots denoted by srcSearchPath
for uri
.
Fails if uri
is not a file://
uri or if the given uri
cannot be found in srcSearchPath
.