Visit nodes, passing in a surrounding context (the innermost one) and accumulating results on the way back up.
Equations
- Lean.Elab.InfoTree.visitM preNode postNode = Lean.Elab.InfoTree.visitM.go preNode postNode none
InfoTree.visitM
specialized to Unit
return type
Equations
- Lean.Elab.InfoTree.visitM' preNode postNode t = discard (Lean.Elab.InfoTree.visitM preNode (fun ci i cs x => postNode ci i cs) t)
Visit nodes bottom-up, passing in a surrounding context (the innermost one) and the union of nested results (empty at leaves).
Equations
- Lean.Elab.InfoTree.collectNodesBottomUp p i = Option.getD (Lean.Elab.InfoTree.visitM (fun x x x => pure ()) (fun ci i cs as => p ci i cs (List.join (List.filterMap id as))) i) []
For every branch of the InfoTree
, find the deepest node in that branch for which p
returns
some _
and return the union of all such nodes. The visitor p
is given a node together with
its innermost surrounding ContextInfo
.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Elab.InfoTree.foldInfo f init = Lean.Elab.InfoTree.foldInfo.go f none init
Equations
- Lean.Elab.Info.isTerm x = match x with | Lean.Elab.Info.ofTermInfo i => true | x => false
Equations
- Lean.Elab.Info.isCompletion x = match x with | Lean.Elab.Info.ofCompletionInfo i => true | x => false
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.Elab.Info.lctx x = match x with | Lean.Elab.Info.ofTermInfo i => i.lctx | Lean.Elab.Info.ofFieldInfo i => i.lctx | x => Lean.LocalContext.empty
Equations
Equations
Equations
Equations
- Lean.Elab.Info.contains i pos includeStop = Option.any (fun x => String.Range.contains x pos includeStop) (Lean.Elab.Info.range? i)
Equations
- Lean.Elab.Info.size? i = do let pos ← Lean.Elab.Info.pos? i let tailPos ← Lean.Elab.Info.tailPos? i pure (tailPos - pos)
Equations
- Lean.Elab.Info.isSmaller i₁ i₂ = match Lean.Elab.Info.size? i₁, Lean.Elab.Info.pos? i₂ with | some sz₁, some sz₂ => decide (sz₁ < sz₂) | some val, none => true | x, x_1 => false
Equations
- Lean.Elab.Info.occursBefore? i hoverPos = do let tailPos ← Lean.Elab.Info.tailPos? i guard (tailPos ≤ hoverPos) pure (hoverPos - tailPos)
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.
Find an info node, if any, which should be shown on hover/cursor at position hoverPos
.
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.
Construct a hover popup, if any, from an info node in a context.
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
- Lean.Elab.Info.fmtHover?.isAtomicFormat (Std.Format.text a) = true
- Lean.Elab.Info.fmtHover?.isAtomicFormat (Lean.Format.group f behavior) = Lean.Elab.Info.fmtHover?.isAtomicFormat f
- Lean.Elab.Info.fmtHover?.isAtomicFormat (Lean.Format.nest indent f) = Lean.Elab.Info.fmtHover?.isAtomicFormat f
- Lean.Elab.Info.fmtHover?.isAtomicFormat (Lean.Format.tag a f) = Lean.Elab.Info.fmtHover?.isAtomicFormat f
- Lean.Elab.Info.fmtHover?.isAtomicFormat x = false
- ctxInfo : Lean.Elab.ContextInfo
- tacticInfo : Lean.Elab.TacticInfo
- useAfter : Bool
Whether the tactic info is further indented than the hover position.
indented : Bool- priority : Nat
Instances For
Try to retrieve TacticInfo
for hoverPos
.
We retrieve all TacticInfo
nodes s.t. hoverPos
is inside the node's range plus trailing whitespace.
We usually prefer the innermost such nodes so that for composite tactics such as induction
, we show the nested proofs' states.
However, if hoverPos
is after the tactic, we prefer nodes that are not indented relative to it, meaning that e.g. at |
in
have := by
exact foo
|
we show the (final, see below) state of have
, not exact
.
Moreover, we instruct the LSP server to use the state after tactic execution if
- the hover position is after the info's start position and
- there is no nested tactic info after the hover position (tactic combinators should decide for themselves
where to show intermediate states by calling
withTacticInfoContext
)
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.Elab.InfoTree.termGoalAt? t hoverPos = Lean.Elab.InfoTree.hoverableInfoAt? t hoverPos true true