File: .lake/packages/lean4/src/lean/Lean/Language/Basic.lean

full_name: Lean.Language.Snapshot.Diagnostics.msgLog
code: /--
`MessageLog` with interactive diagnostics.

Can be created using `Diagnostics.empty` or `Diagnostics.ofMessageLog`.
-/
structure Snapshot.Diagnostics where
  private mk ::
  /-- Non-interactive message log. -/
  msgLog : MessageLog
  /--
  Dynamic mutable slot usable by the language server for memorizing interactive diagnostics. If
  `none`, interactive diagnostics are not remembered, which should only be used for messages not
  containing any interactive elements as client-side state will be lost on recreating a diagnostic.

  See also section "Communication" in Lean/Server/README.md.
  -/
  interactiveDiagsRef? : Option (IO.Ref (Option Dynamic))
deriving Inhabited
goal: Lean.MessageLog

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Language.Basic.0.Lean.Language.Snapshot.Diagnostics.mk
code: /--
`MessageLog` with interactive diagnostics.

Can be created using `Diagnostics.empty` or `Diagnostics.ofMessageLog`.
-/
structure Snapshot.Diagnostics where
  private mk ::
  /-- Non-interactive message log. -/
  msgLog : MessageLog
  /--
  Dynamic mutable slot usable by the language server for memorizing interactive diagnostics. If
  `none`, interactive diagnostics are not remembered, which should only be used for messages not
  containing any interactive elements as client-side state will be lost on recreating a diagnostic.

  See also section "Communication" in Lean/Server/README.md.
  -/
  interactiveDiagsRef? : Option (IO.Ref (Option Dynamic))
deriving Inhabited
goal: Lean.Language.Snapshot.Diagnostics

full_name: Lean.Language.Snapshot.instInhabitedDiagnostics
code: /--
`MessageLog` with interactive diagnostics.

Can be created using `Diagnostics.empty` or `Diagnostics.ofMessageLog`.
-/
structure Snapshot.Diagnostics where
  private mk ::
  /-- Non-interactive message log. -/
  msgLog : MessageLog
  /--
  Dynamic mutable slot usable by the language server for memorizing interactive diagnostics. If
  `none`, interactive diagnostics are not remembered, which should only be used for messages not
  containing any interactive elements as client-side state will be lost on recreating a diagnostic.

  See also section "Communication" in Lean/Server/README.md.
  -/
  interactiveDiagsRef? : Option (IO.Ref (Option Dynamic))
deriving Inhabited
goal: Inhabited Lean.Language.Snapshot.Diagnostics

full_name: Lean.Language.Snapshot.Diagnostics
code: /--
`MessageLog` with interactive diagnostics.

Can be created using `Diagnostics.empty` or `Diagnostics.ofMessageLog`.
-/
structure Snapshot.Diagnostics where
  private mk ::
  /-- Non-interactive message log. -/
  msgLog : MessageLog
  /--
  Dynamic mutable slot usable by the language server for memorizing interactive diagnostics. If
  `none`, interactive diagnostics are not remembered, which should only be used for messages not
  containing any interactive elements as client-side state will be lost on recreating a diagnostic.

  See also section "Communication" in Lean/Server/README.md.
  -/
  interactiveDiagsRef? : Option (IO.Ref (Option Dynamic))
deriving Inhabited
goal: Type

full_name: Lean.Language.Snapshot.Diagnostics.interactiveDiagsRef?
code: /--
`MessageLog` with interactive diagnostics.

Can be created using `Diagnostics.empty` or `Diagnostics.ofMessageLog`.
-/
structure Snapshot.Diagnostics where
  private mk ::
  /-- Non-interactive message log. -/
  msgLog : MessageLog
  /--
  Dynamic mutable slot usable by the language server for memorizing interactive diagnostics. If
  `none`, interactive diagnostics are not remembered, which should only be used for messages not
  containing any interactive elements as client-side state will be lost on recreating a diagnostic.

  See also section "Communication" in Lean/Server/README.md.
  -/
  interactiveDiagsRef? : Option (IO.Ref (Option Dynamic))
deriving Inhabited
goal: Option (IO.Ref (Option Dynamic))

full_name: Lean.Language.Snapshot.Diagnostics.empty
code: /-- The empty set of diagnostics. -/
def Snapshot.Diagnostics.empty : Snapshot.Diagnostics 
goal: Lean.Language.Snapshot.Diagnostics

full_name: Lean.Language.Snapshot.diagnostics
code: /--
  The base class of all snapshots: all the generic information the language server needs about a
  snapshot. -/
structure Snapshot where
  /--
    The messages produced by this step. The union of message logs of all finished snapshots is
    reported to the user. -/
  diagnostics : Snapshot.Diagnostics
  /-- General elaboration metadata produced by this step. -/
  infoTree? : Option Elab.InfoTree := none
  /--
  Whether it should be indicated to the user that a fatal error (which should be part of
  `diagnostics`) occurred that prevents processing of the remainder of the file.
  -/
  isFatal := false
deriving Inhabited
goal: Lean.Language.Snapshot.Diagnostics

full_name: Lean.Language.instInhabitedSnapshot
code: /--
  The base class of all snapshots: all the generic information the language server needs about a
  snapshot. -/
structure Snapshot where
  /--
    The messages produced by this step. The union of message logs of all finished snapshots is
    reported to the user. -/
  diagnostics : Snapshot.Diagnostics
  /-- General elaboration metadata produced by this step. -/
  infoTree? : Option Elab.InfoTree := none
  /--
  Whether it should be indicated to the user that a fatal error (which should be part of
  `diagnostics`) occurred that prevents processing of the remainder of the file.
  -/
  isFatal := false
deriving Inhabited
goal: Inhabited Lean.Language.Snapshot

full_name: Lean.Language.Snapshot
code: /--
  The base class of all snapshots: all the generic information the language server needs about a
  snapshot. -/
structure Snapshot where
  /--
    The messages produced by this step. The union of message logs of all finished snapshots is
    reported to the user. -/
  diagnostics : Snapshot.Diagnostics
  /-- General elaboration metadata produced by this step. -/
  infoTree? : Option Elab.InfoTree := none
  /--
  Whether it should be indicated to the user that a fatal error (which should be part of
  `diagnostics`) occurred that prevents processing of the remainder of the file.
  -/
  isFatal := false
deriving Inhabited
goal: Type

full_name: Lean.Language.Snapshot.infoTree?
code: /--
  The base class of all snapshots: all the generic information the language server needs about a
  snapshot. -/
structure Snapshot where
  /--
    The messages produced by this step. The union of message logs of all finished snapshots is
    reported to the user. -/
  diagnostics : Snapshot.Diagnostics
  /-- General elaboration metadata produced by this step. -/
  infoTree? : Option Elab.InfoTree := none
  /--
  Whether it should be indicated to the user that a fatal error (which should be part of
  `diagnostics`) occurred that prevents processing of the remainder of the file.
  -/
  isFatal := false
deriving Inhabited
goal: Option Lean.Elab.InfoTree

full_name: Lean.Language.Snapshot.isFatal
code: /--
  The base class of all snapshots: all the generic information the language server needs about a
  snapshot. -/
structure Snapshot where
  /--
    The messages produced by this step. The union of message logs of all finished snapshots is
    reported to the user. -/
  diagnostics : Snapshot.Diagnostics
  /-- General elaboration metadata produced by this step. -/
  infoTree? : Option Elab.InfoTree := none
  /--
  Whether it should be indicated to the user that a fatal error (which should be part of
  `diagnostics`) occurred that prevents processing of the remainder of the file.
  -/
  isFatal := false
deriving Inhabited
goal: Bool

full_name: Lean.Language.SnapshotTask.range?
code: /-- A task producing some snapshot type (usually a subclass of `Snapshot`). -/
-- Longer-term TODO: Give the server more control over the priority of tasks, depending on e.g. the
-- cursor position. This may require starting the tasks suspended (e.g. in `Thunk`). The server may
-- also need more dependency information for this in order to avoid priority inversion.
structure SnapshotTask (α : Type) where
  /--
  Range that is marked as being processed by the server while the task is running. If `none`,
  the range of the outer task if some or else the entire file is reported.
  -/
  range? : Option String.Range
  /-- Underlying task producing the snapshot. -/
  task : Task α
deriving Nonempty
goal: Option String.Range

full_name: Lean.Language.instNonemptySnapshotTask
code: /-- A task producing some snapshot type (usually a subclass of `Snapshot`). -/
-- Longer-term TODO: Give the server more control over the priority of tasks, depending on e.g. the
-- cursor position. This may require starting the tasks suspended (e.g. in `Thunk`). The server may
-- also need more dependency information for this in order to avoid priority inversion.
structure SnapshotTask (α : Type) where
  /--
  Range that is marked as being processed by the server while the task is running. If `none`,
  the range of the outer task if some or else the entire file is reported.
  -/
  range? : Option String.Range
  /-- Underlying task producing the snapshot. -/
  task : Task α
deriving Nonempty
goal: ∀ {α : Type} [inst : Nonempty α], Nonempty (Lean.Language.SnapshotTask α)

full_name: Lean.Language.SnapshotTask.task
code: /-- A task producing some snapshot type (usually a subclass of `Snapshot`). -/
-- Longer-term TODO: Give the server more control over the priority of tasks, depending on e.g. the
-- cursor position. This may require starting the tasks suspended (e.g. in `Thunk`). The server may
-- also need more dependency information for this in order to avoid priority inversion.
structure SnapshotTask (α : Type) where
  /--
  Range that is marked as being processed by the server while the task is running. If `none`,
  the range of the outer task if some or else the entire file is reported.
  -/
  range? : Option String.Range
  /-- Underlying task producing the snapshot. -/
  task : Task α
deriving Nonempty
goal: Task α

full_name: Lean.Language.SnapshotTask
code: /-- A task producing some snapshot type (usually a subclass of `Snapshot`). -/
-- Longer-term TODO: Give the server more control over the priority of tasks, depending on e.g. the
-- cursor position. This may require starting the tasks suspended (e.g. in `Thunk`). The server may
-- also need more dependency information for this in order to avoid priority inversion.
structure SnapshotTask (α : Type) where
  /--
  Range that is marked as being processed by the server while the task is running. If `none`,
  the range of the outer task if some or else the entire file is reported.
  -/
  range? : Option String.Range
  /-- Underlying task producing the snapshot. -/
  task : Task α
deriving Nonempty
goal: Type

full_name: Lean.Language.SnapshotTask.ofIO
code: /-- Creates a snapshot task from a reporting range and a `BaseIO` action. -/
def SnapshotTask.ofIO (range? : Option String.Range) (act : BaseIO α) : BaseIO (SnapshotTask α) 
goal: BaseIO (Lean.Language.SnapshotTask α)

full_name: Lean.Language.SnapshotTask.pure
code: /-- Creates a finished snapshot task. -/
def SnapshotTask.pure (a : α) : SnapshotTask α 
goal: Lean.Language.SnapshotTask α

full_name: Lean.Language.SnapshotTask.cancel
code: /--
  Explicitly cancels a tasks. Like with basic `Tasks`s, cancellation happens implicitly when the
  last reference to the task is dropped *if* it is not an I/O task. -/
def SnapshotTask.cancel (t : SnapshotTask α) : BaseIO Unit 
goal: BaseIO Unit

full_name: Lean.Language.SnapshotTask.map
code: /-- Transforms a task's output without changing the reporting range. -/
def SnapshotTask.map (t : SnapshotTask α) (f : α → β) (range? : Option String.Range := t.range?)
    (sync := false) : SnapshotTask β 
goal: Lean.Language.SnapshotTask β

full_name: Lean.Language.SnapshotTask.bind
code: /--
  Chains two snapshot tasks. The range is taken from the first task if not specified; the range of
  the second task is discarded. -/
def SnapshotTask.bind (t : SnapshotTask α) (act : α → SnapshotTask β)
    (range? : Option String.Range := t.range?) (sync := false) : SnapshotTask β 
goal: Lean.Language.SnapshotTask β

full_name: Lean.Language.SnapshotTask.bindIO
code: /--
  Chains two snapshot tasks. The range is taken from the first task if not specified; the range of
  the second task is discarded. -/
def SnapshotTask.bindIO (t : SnapshotTask α) (act : α → BaseIO (SnapshotTask β))
    (range? : Option String.Range := t.range?) (sync := false) : BaseIO (SnapshotTask β) 
goal: BaseIO (Lean.Language.SnapshotTask β)

full_name: Lean.Language.SnapshotTask.get
code: /-- Synchronously waits on the result of the task. -/
def SnapshotTask.get (t : SnapshotTask α) : α 
goal: α

full_name: Lean.Language.SnapshotTask.get?
code: /-- Returns task result if already finished or else `none`. -/
def SnapshotTask.get? (t : SnapshotTask α) : BaseIO (Option α) 
goal: BaseIO (Option α)

full_name: Lean.Language.SyntaxGuarded.stx
code: /--
Arbitrary value paired with a syntax that should be inspected when considering the value for reuse.
-/
structure SyntaxGuarded (α : Type) where
  /-- Syntax to be inspected for reuse. -/
  stx : Syntax
  /-- Potentially reusable value. -/
  val : α
goal: Lean.Syntax

full_name: Lean.Language.SyntaxGuarded.val
code: /--
Arbitrary value paired with a syntax that should be inspected when considering the value for reuse.
-/
structure SyntaxGuarded (α : Type) where
  /-- Syntax to be inspected for reuse. -/
  stx : Syntax
  /-- Potentially reusable value. -/
  val : α
goal: α

full_name: Lean.Language.SyntaxGuarded
code: /--
Arbitrary value paired with a syntax that should be inspected when considering the value for reuse.
-/
structure SyntaxGuarded (α : Type) where
  /-- Syntax to be inspected for reuse. -/
  stx : Syntax
  /-- Potentially reusable value. -/
  val : α
goal: Type

full_name: Lean.Language.SnapshotBundle.new
code: /--
Pair of (optional) old snapshot task usable for incremental reuse and new snapshot promise for
incremental reporting. Inside the elaborator, we build snapshots by carrying such bundles and then
checking if we can reuse `old?` if set or else redoing the corresponding elaboration step. In either
case, we derive new bundles for nested snapshots, if any, and finally `resolve` `new` to the result.

Note that failing to `resolve` a created promise will block the language server indefinitely!
We use `withAlwaysResolvedPromise`/`withAlwaysResolvedPromises` to ensure this doesn't happen.

In the future, the 1-element history `old?` may be replaced with a global cache indexed by strong
hashes but the promise will still need to be passed through the elaborator.
-/
structure SnapshotBundle (α : Type) where
  /--
  Snapshot task of corresponding elaboration in previous document version if any, paired with its
  old syntax to be considered for reuse. Should be set to `none` as soon as reuse can be ruled out.
  -/
  old? : Option (SyntaxGuarded (SnapshotTask α))
  /--
  Promise of snapshot value for the current document. When resolved, the language server will
  report its result even before the current elaborator invocation has finished.
  -/
  new  : IO.Promise α
goal: IO.Promise α

full_name: Lean.Language.SnapshotBundle.old?
code: /--
Pair of (optional) old snapshot task usable for incremental reuse and new snapshot promise for
incremental reporting. Inside the elaborator, we build snapshots by carrying such bundles and then
checking if we can reuse `old?` if set or else redoing the corresponding elaboration step. In either
case, we derive new bundles for nested snapshots, if any, and finally `resolve` `new` to the result.

Note that failing to `resolve` a created promise will block the language server indefinitely!
We use `withAlwaysResolvedPromise`/`withAlwaysResolvedPromises` to ensure this doesn't happen.

In the future, the 1-element history `old?` may be replaced with a global cache indexed by strong
hashes but the promise will still need to be passed through the elaborator.
-/
structure SnapshotBundle (α : Type) where
  /--
  Snapshot task of corresponding elaboration in previous document version if any, paired with its
  old syntax to be considered for reuse. Should be set to `none` as soon as reuse can be ruled out.
  -/
  old? : Option (SyntaxGuarded (SnapshotTask α))
  /--
  Promise of snapshot value for the current document. When resolved, the language server will
  report its result even before the current elaborator invocation has finished.
  -/
  new  : IO.Promise α
goal: Option (Lean.Language.SyntaxGuarded (Lean.Language.SnapshotTask α))

full_name: Lean.Language.SnapshotBundle
code: /--
Pair of (optional) old snapshot task usable for incremental reuse and new snapshot promise for
incremental reporting. Inside the elaborator, we build snapshots by carrying such bundles and then
checking if we can reuse `old?` if set or else redoing the corresponding elaboration step. In either
case, we derive new bundles for nested snapshots, if any, and finally `resolve` `new` to the result.

Note that failing to `resolve` a created promise will block the language server indefinitely!
We use `withAlwaysResolvedPromise`/`withAlwaysResolvedPromises` to ensure this doesn't happen.

In the future, the 1-element history `old?` may be replaced with a global cache indexed by strong
hashes but the promise will still need to be passed through the elaborator.
-/
structure SnapshotBundle (α : Type) where
  /--
  Snapshot task of corresponding elaboration in previous document version if any, paired with its
  old syntax to be considered for reuse. Should be set to `none` as soon as reuse can be ruled out.
  -/
  old? : Option (SyntaxGuarded (SnapshotTask α))
  /--
  Promise of snapshot value for the current document. When resolved, the language server will
  report its result even before the current elaborator invocation has finished.
  -/
  new  : IO.Promise α
goal: Type

full_name: Lean.Language.withAlwaysResolvedPromise
code: /--
Runs `act` with a newly created promise and finally resolves it to `default` if not done by `act`.

Always resolving promises involved in the snapshot tree is important to avoid deadlocking the
language server.
-/
def withAlwaysResolvedPromise [Monad m] [MonadLiftT BaseIO m] [MonadFinally m] [Inhabited α]
    (act : IO.Promise α → m β) : m β 
goal: m β

full_name: Lean.Language.withAlwaysResolvedPromises
code: /--
Runs `act` with `count` newly created promises and finally resolves them to `default` if not done by
`act`.

Always resolving promises involved in the snapshot tree is important to avoid deadlocking the
language server.
-/
def withAlwaysResolvedPromises [Monad m] [MonadLiftT BaseIO m] [MonadFinally m] [Inhabited α]
    (count : Nat) (act : Array (IO.Promise α) → m Unit) : m Unit 
goal: m Unit

full_name: Lean.Language.instInhabitedSnapshotTree
code: /--
  Tree of snapshots where each snapshot comes with an array of asynchronous further subtrees. Used
  for asynchronously collecting information about the entirety of snapshots in the language server.
  The involved tasks may form a DAG on the `Task` dependency level but this is not captured by this
  data structure. -/
inductive SnapshotTree where
  /-- Creates a snapshot tree node. -/
  | mk (element : Snapshot) (children : Array (SnapshotTask SnapshotTree))
deriving Inhabited
goal: Inhabited Lean.Language.SnapshotTree

full_name: Lean.Language.SnapshotTree.mk
code: /--
  Tree of snapshots where each snapshot comes with an array of asynchronous further subtrees. Used
  for asynchronously collecting information about the entirety of snapshots in the language server.
  The involved tasks may form a DAG on the `Task` dependency level but this is not captured by this
  data structure. -/
inductive SnapshotTree where
  /-- Creates a snapshot tree node. -/
  | mk (element : Snapshot) (children : Array (SnapshotTask SnapshotTree))
deriving Inhabited
goal: Lean.Language.SnapshotTree

full_name: Lean.Language.SnapshotTree
code: /--
  Tree of snapshots where each snapshot comes with an array of asynchronous further subtrees. Used
  for asynchronously collecting information about the entirety of snapshots in the language server.
  The involved tasks may form a DAG on the `Task` dependency level but this is not captured by this
  data structure. -/
inductive SnapshotTree where
  /-- Creates a snapshot tree node. -/
  | mk (element : Snapshot) (children : Array (SnapshotTask SnapshotTree))
deriving Inhabited
goal: Type

full_name: Lean.Language.SnapshotTree.element
code: /-- The immediately available element of the snapshot tree node. -/
abbrev SnapshotTree.element : SnapshotTree → Snapshot
  
goal: Lean.Language.SnapshotTree → Lean.Language.Snapshot

full_name: Lean.Language.SnapshotTree.children
code: /-- The asynchronously available children of the snapshot tree node. -/
abbrev SnapshotTree.children : SnapshotTree → Array (SnapshotTask SnapshotTree)
  
goal: Lean.Language.SnapshotTree → Array (Lean.Language.SnapshotTask Lean.Language.SnapshotTree)

full_name: Lean.Language.SnapshotTree.format
code: /-- Produces debug tree format of given snapshot tree, synchronously waiting on all children. -/
partial def SnapshotTree.format : SnapshotTree → Format 
goal: Lean.Language.SnapshotTree → Lean.Format

full_name: Lean.Language.SnapshotTree.format.go
code: /-- Produces debug tree format of given snapshot tree, synchronously waiting on all children. -/
partial def SnapshotTree.format : SnapshotTree → Format 
goal: Lean.Format

full_name: Lean.Language.ToSnapshotTree
code: /--
  Helper class for projecting a heterogeneous hierarchy of snapshot classes to a homogeneous
  representation. -/
class ToSnapshotTree (α : Type) where
  /-- Transforms a language-specific snapshot to a homogeneous snapshot tree. -/
  toSnapshotTree : α → SnapshotTree
goal: Type

full_name: Lean.Language.ToSnapshotTree.toSnapshotTree
code: /--
  Helper class for projecting a heterogeneous hierarchy of snapshot classes to a homogeneous
  representation. -/
class ToSnapshotTree (α : Type) where
  /-- Transforms a language-specific snapshot to a homogeneous snapshot tree. -/
  toSnapshotTree : α → SnapshotTree
goal: α → Lean.Language.SnapshotTree

full_name: Lean.Language.instToSnapshotTreeOption
code: instance [ToSnapshotTree α] : ToSnapshotTree (Option α) 
goal: Lean.Language.ToSnapshotTree (Option α)

full_name: Lean.Language.SnapshotLeaf
code: /-- Snapshot type without child nodes. -/
structure SnapshotLeaf extends Snapshot
deriving Nonempty, TypeName
goal: Type

full_name: Lean.Language.instNonemptySnapshotLeaf
code: /-- Snapshot type without child nodes. -/
structure SnapshotLeaf extends Snapshot
deriving Nonempty, TypeName
goal: Nonempty Lean.Language.SnapshotLeaf

full_name: Lean.Language.instImpl._@..lake.packages.lean4.src.lean.Lean.Language.Basic._hyg.1129
code: TypeName
goal: TypeName Lean.Language.SnapshotLeaf

full_name: Lean.Language.instTypeNameSnapshotLeaf
code: TypeName
goal: TypeName Lean.Language.SnapshotLeaf

full_name: Lean.Language.inst._@..lake.packages.lean4.src.lean.Lean.Language.Basic._hyg.1129
code: TypeName
goal: TypeName Lean.Language.SnapshotLeaf

full_name: Lean.Language.instToSnapshotTreeSnapshotLeaf
code: instance : ToSnapshotTree SnapshotLeaf 
goal: Lean.Language.ToSnapshotTree Lean.Language.SnapshotLeaf

full_name: Lean.Language.DynamicSnapshot
code: /-- Arbitrary snapshot type, used for extensibility. -/
structure DynamicSnapshot where
  /-- Concrete snapshot value as `Dynamic`. -/
  val  : Dynamic
  /-- Snapshot tree retrieved from `val` before erasure. -/
  tree : SnapshotTree
goal: Type

full_name: Lean.Language.DynamicSnapshot.val
code: /-- Arbitrary snapshot type, used for extensibility. -/
structure DynamicSnapshot where
  /-- Concrete snapshot value as `Dynamic`. -/
  val  : Dynamic
  /-- Snapshot tree retrieved from `val` before erasure. -/
  tree : SnapshotTree
goal: Dynamic

full_name: Lean.Language.DynamicSnapshot.tree
code: /-- Arbitrary snapshot type, used for extensibility. -/
structure DynamicSnapshot where
  /-- Concrete snapshot value as `Dynamic`. -/
  val  : Dynamic
  /-- Snapshot tree retrieved from `val` before erasure. -/
  tree : SnapshotTree
goal: Lean.Language.SnapshotTree

full_name: Lean.Language.instToSnapshotTreeDynamicSnapshot
code: instance : ToSnapshotTree DynamicSnapshot 
goal: Lean.Language.ToSnapshotTree Lean.Language.DynamicSnapshot

full_name: Lean.Language.DynamicSnapshot.ofTyped
code: /-- Creates a `DynamicSnapshot` from a typed snapshot value. -/
def DynamicSnapshot.ofTyped [TypeName α] [ToSnapshotTree α] (val : α) : DynamicSnapshot 
goal: Lean.Language.DynamicSnapshot

full_name: Lean.Language.DynamicSnapshot.toTyped?
code: /-- Returns the original snapshot value if it is of the given type. -/
def DynamicSnapshot.toTyped? (α : Type) [TypeName α] (snap : DynamicSnapshot) :
    Option α 
goal: Option α

full_name: Lean.Language.instInhabitedDynamicSnapshot
code: instance : Inhabited DynamicSnapshot 
goal: Inhabited Lean.Language.DynamicSnapshot

full_name: Lean.Language.SnapshotTree.forM
code: /--
  Runs a tree of snapshots to conclusion, incrementally performing `f` on each snapshot in tree
  preorder. -/
@[specialize] partial def SnapshotTree.forM [Monad m] (s : SnapshotTree)
    (f : Snapshot → m PUnit) : m PUnit 
goal: m PUnit

full_name: Lean.Language.initFn._@..lake.packages.lean4.src.lean.Lean.Language.Basic._hyg.1332
code: /--
  Option for printing end position of each message in addition to start position. Used for testing
  message ranges in the test suite. -/
register_builtin_option printMessageEndPos : Bool := {
  defValue := false, descr := "print end position of each message in addition to start position"
}
goal: IO (Lean.Option Bool)

full_name: Lean.Language.printMessageEndPos
code: /--
  Option for printing end position of each message in addition to start position. Used for testing
  message ranges in the test suite. -/
register_builtin_option printMessageEndPos : Bool := {
  defValue := false, descr := "print end position of each message in addition to start position"
}
goal: Lean.Option Bool

full_name: Lean.Language.reportMessages
code: /-- Reports messages on stdout. If `json` is true, prints messages as JSON (one per line). -/
def reportMessages (msgLog : MessageLog) (opts : Options) (json := false) : IO Unit 
goal: IO Unit

full_name: Lean.Language.SnapshotTree.runAndReport
code: /--
  Runs a tree of snapshots to conclusion and incrementally report messages on stdout. Messages are
  reported in tree preorder.
  This function is used by the cmdline driver; see `Lean.Server.FileWorker.reportSnapshots` for how
  the language server reports snapshots asynchronously.  -/
def SnapshotTree.runAndReport (s : SnapshotTree) (opts : Options) (json := false) : IO Unit 
goal: IO Unit

full_name: Lean.Language.SnapshotTree.getAll
code: /-- Waits on and returns all snapshots in the tree. -/
def SnapshotTree.getAll (s : SnapshotTree) : Array Snapshot 
goal: Array Lean.Language.Snapshot

full_name: Lean.Language.ProcessingContext
code: /-- Context of an input processing invocation. -/
structure ProcessingContext extends Parser.InputContext
goal: Type

full_name: Lean.Language.ProcessingT
code: /-- Monad transformer holding all relevant data for processing. -/
abbrev ProcessingT m 
goal: Type u_1

full_name: Lean.Language.ProcessingM
code: /-- Monad holding all relevant data for processing. -/
abbrev ProcessingM 
goal: Type

full_name: Lean.Language.instMonadLiftProcessingMProcessingTIO
code: instance : MonadLift ProcessingM (ProcessingT IO) 
goal: MonadLift Lean.Language.ProcessingM (Lean.Language.ProcessingT IO)

full_name: Lean.Language.Snapshot.Diagnostics.ofMessageLog
code: /--
Creates snapshot message log from non-interactive message log, also allocating a mutable cell
that can be used by the server to memorize interactive diagnostics derived from the log.
-/
def Snapshot.Diagnostics.ofMessageLog (msgLog : Lean.MessageLog) :
    BaseIO Snapshot.Diagnostics 
goal: BaseIO Lean.Language.Snapshot.Diagnostics

full_name: Lean.Language.diagnosticsOfHeaderError
code: /-- Creates diagnostics from a single error message that should span the whole file. -/
def diagnosticsOfHeaderError (msg : String) : ProcessingM Snapshot.Diagnostics 
goal: Lean.Language.ProcessingM Lean.Language.Snapshot.Diagnostics

full_name: Lean.Language.withHeaderExceptions
code: /--
  Adds unexpected exceptions from header processing to the message log as a last resort; standard
  errors should already have been caught earlier. -/
def withHeaderExceptions (ex : Snapshot → α) (act : ProcessingT IO α) : ProcessingM α 
goal: Lean.Language.ProcessingM α

full_name: Lean.Language.mkIncrementalProcessor
code: /--
  Builds a function for processing a language using incremental snapshots by passing the previous
  snapshot to `Language.process` on subsequent invocations. -/
def Language.mkIncrementalProcessor (process : Option InitSnap → ProcessingM InitSnap) :
    BaseIO (Parser.InputContext → BaseIO InitSnap) 
goal: BaseIO (Lean.Parser.InputContext → BaseIO InitSnap)