Merges the inner partial context into the outer context s.t. fields of the inner context
overwrite fields of the outer context. Panics if the invariant described in the documentation
for PartialContextInfo is violated.
When traversing an InfoTree, this function should be used to combine the context of outer
nodes with the partial context of their subtrees. This ensures that the traversal has the context
from the inner node to the root node of the InfoTree available, with partial contexts of
inner nodes taking priority over contexts of outer nodes.
Equations
- One or more equations did not get rendered due to their size.
- (Lean.Elab.PartialContextInfo.commandCtx info).mergeIntoOuter? none = some { toCommandContextInfo := info }
Instances For
Equations
- (Lean.Elab.CompletionInfo.dot i expectedType?).stx = i.stx
- (Lean.Elab.CompletionInfo.id stx id danglingDot lctx expectedType?).stx = stx
- (Lean.Elab.CompletionInfo.dotId stx id lctx expectedType?).stx = stx
- (Lean.Elab.CompletionInfo.fieldId stx id lctx structName).stx = stx
- (Lean.Elab.CompletionInfo.namespaceId stx).stx = stx
- (Lean.Elab.CompletionInfo.option stx).stx = stx
- (Lean.Elab.CompletionInfo.errorName stx partialId).stx = stx
- (Lean.Elab.CompletionInfo.endSection stx id? danglingDot scopeNames).stx = stx
- (Lean.Elab.CompletionInfo.tactic stx).stx = stx
Instances For
Obtains the LocalContext from this CompletionInfo if available and yields an empty context
otherwise.
Equations
- (Lean.Elab.CompletionInfo.dot i expectedType?).lctx = i.lctx
- (Lean.Elab.CompletionInfo.id stx id danglingDot lctx expectedType?).lctx = lctx
- (Lean.Elab.CompletionInfo.dotId stx id lctx expectedType?).lctx = lctx
- (Lean.Elab.CompletionInfo.fieldId stx id lctx structName).lctx = lctx
- x✝.lctx = Lean.LocalContext.empty
Instances For
Instantiate the holes on the given tree with the assignment table.
(analogous to instantiating the metavariables in an expression)
Applies s.lazyAssignment to s.trees, asynchronously.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- (Lean.Elab.Info.ofTacticInfo i).toElabInfo? = some i.toElabInfo
- (Lean.Elab.Info.ofTermInfo i).toElabInfo? = some i.toElabInfo
- (Lean.Elab.Info.ofPartialTermInfo i).toElabInfo? = some i.toElabInfo
- (Lean.Elab.Info.ofCommandInfo i).toElabInfo? = some i.toElabInfo
- (Lean.Elab.Info.ofMacroExpansionInfo i).toElabInfo? = none
- (Lean.Elab.Info.ofOptionInfo i).toElabInfo? = none
- (Lean.Elab.Info.ofErrorNameInfo i).toElabInfo? = none
- (Lean.Elab.Info.ofFieldInfo i).toElabInfo? = none
- (Lean.Elab.Info.ofCompletionInfo i).toElabInfo? = none
- (Lean.Elab.Info.ofUserWidgetInfo i).toElabInfo? = none
- (Lean.Elab.Info.ofCustomInfo i).toElabInfo? = none
- (Lean.Elab.Info.ofFVarAliasInfo i).toElabInfo? = none
- (Lean.Elab.Info.ofFieldRedeclInfo i).toElabInfo? = none
- (Lean.Elab.Info.ofDelabTermInfo i).toElabInfo? = some i.toElabInfo
- (Lean.Elab.Info.ofChoiceInfo i).toElabInfo? = some i.toElabInfo
- (Lean.Elab.Info.ofDocInfo i).toElabInfo? = some i.toElabInfo
- (Lean.Elab.Info.ofDocElabInfo i).toElabInfo? = some i.toElabInfo
Instances For
Helper function for propagating the tactic metavariable context to its children nodes.
We need this function because we preserve TacticInfo nodes during backtracking and their
children. Moreover, we backtrack the metavariable context to undo metavariable assignments.
TacticInfo nodes save the metavariable context before/after the tactic application, and
can be pretty printed without any extra information. This is not the case for TermInfo nodes.
Without this function, the formatting method would often fail when processing TermInfo nodes
that are children of TacticInfo nodes that have been preserved during backtracking.
Saving the metavariable context at TermInfo nodes is also not a good option because
at TermInfo creation time, the metavariable context often miss information, e.g.,
a TC problem has not been resolved, a postponed subterm has not been elaborated, etc.
See Term.SavedState.restore.
Equations
- One or more equations did not get rendered due to their size.
- Lean.Elab.Info.updateContext? x✝¹ x✝ = x✝¹
Instances For
Equations
- (Lean.Elab.Info.ofTacticInfo i).stx = i.stx
- (Lean.Elab.Info.ofTermInfo i).stx = i.stx
- (Lean.Elab.Info.ofPartialTermInfo i).stx = i.stx
- (Lean.Elab.Info.ofCommandInfo i).stx = i.stx
- (Lean.Elab.Info.ofMacroExpansionInfo i).stx = i.stx
- (Lean.Elab.Info.ofOptionInfo i).stx = i.stx
- (Lean.Elab.Info.ofErrorNameInfo i).stx = i.stx
- (Lean.Elab.Info.ofFieldInfo i).stx = i.stx
- (Lean.Elab.Info.ofCompletionInfo i).stx = i.stx
- (Lean.Elab.Info.ofCustomInfo i).stx = i.stx
- (Lean.Elab.Info.ofUserWidgetInfo i).stx = i.stx
- (Lean.Elab.Info.ofFVarAliasInfo i).stx = Lean.Syntax.missing
- (Lean.Elab.Info.ofFieldRedeclInfo i).stx = i.stx
- (Lean.Elab.Info.ofDelabTermInfo i).stx = i.stx
- (Lean.Elab.Info.ofChoiceInfo i).stx = i.stx
- (Lean.Elab.Info.ofDocInfo i).stx = i.stx
- (Lean.Elab.Info.ofDocElabInfo i).stx = i.stx
Instances For
Adds the given trailing substring to all adjacent syntax in the info tree if any, otherwise returns
none.
Adds the given trailing substring to all adjacent syntax in the info tree.
Equations
- Lean.Elab.InfoTree.addTrailing trailing t = (Lean.Elab.InfoTree.addTrailing? trailing t).getD t