RPC infrastructure for storing and formatting code fragments, in particular Expr
s,
with environment and subexpression information.
- green: Lean.Widget.HighlightColor
- blue: Lean.Widget.HighlightColor
- red: Lean.Widget.HighlightColor
- yellow: Lean.Widget.HighlightColor
- purple: Lean.Widget.HighlightColor
Instances For
Equations
- Lean.Widget.instFromJsonHighlightColor = { fromJson? := Lean.Widget.fromJsonHighlightColor✝ }
The
Elab.Info
node with the semantics of this part of the output.The position of this subexpression within the top-level expression. See
Lean.SubExpr
.subexprPos : Lean.SubExpr.PosAsk the renderer to highlight this node in the given color.
highlightColor? : Option Lean.Widget.HighlightColor
Information about a subexpression within delaborated code.
Instances For
Equations
- Lean.Widget.instInhabitedSubexprInfo = { default := { info := default, subexprPos := default, highlightColor? := default } }
Equations
- Lean.Widget.instRpcEncodableSubexprInfo = { rpcEncode := Lean.Widget.instRpcEncodableSubexprInfo.enc✝, rpcDecode := Lean.Widget.instRpcEncodableSubexprInfo.dec✝ }
@[inline]
Pretty-printed syntax (usually but not necessarily an Expr
) with embedded Info
s.
def
Lean.Widget.CodeWithInfos.mergePosMap
{m : Type → Type u_1}
{α : Type u_2}
[inst : Monad m]
(merger : Lean.Widget.SubexprInfo → α → m Lean.Widget.SubexprInfo)
(pm : Lean.SubExpr.PosMap α)
(tt : Lean.Widget.CodeWithInfos)
:
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Widget.SubexprInfo.highlight
(color : Lean.Widget.HighlightColor)
(c : Lean.Widget.SubexprInfo)
:
Equations
- Lean.Widget.SubexprInfo.highlight color c = { info := c.info, subexprPos := c.subexprPos, highlightColor? := some color }
def
Lean.Widget.tagExprInfos
(ctx : Lean.Elab.ContextInfo)
(infos : Lean.SubExpr.PosMap Lean.Elab.Info)
(tt : Lean.Widget.TaggedText (Nat × Nat))
:
Tags a pretty-printed Expr
with infos from the delaborator.
Equations
- Lean.Widget.tagExprInfos ctx infos tt = Lean.Widget.tagExprInfos.go ctx infos tt
partial def
Lean.Widget.tagExprInfos.go
(ctx : Lean.Elab.ContextInfo)
(infos : Lean.SubExpr.PosMap Lean.Elab.Info)
(tt : Lean.Widget.TaggedText (Nat × Nat))
:
Equations
- One or more equations did not get rendered due to their size.