- env : Lean.Environment
- fileMap : Lean.FileMap
- mctx : Lean.MetavarContext
- options : Lean.Options
- currNamespace : Lake.Name
- openDecls : List Lean.OpenDecl
- ngen : Lean.NameGenerator
Context after executing liftTermElabM
.
Note that the term information collected during elaboration may contain metavariables, and their
assignments are stored at mctx
.
Instances For
- elaborator : Lake.Name
The name of the elaborator that created this info.
- stx : Lean.Syntax
The piece of syntax that the elaborator created this info for. Note that this also implicitly stores the code position in the syntax's SourceInfo.
Base structure for TermInfo
, CommandInfo
and TacticInfo
.
Instances For
Equations
- Lean.Elab.instInhabitedElabInfo = { default := { elaborator := default, stx := default } }
- elaborator : Lake.Name
- stx : Lean.Syntax
- lctx : Lean.LocalContext
- expr : Lean.Expr
- isBinder : Bool
Instances For
Equations
- Lean.Elab.instInhabitedTermInfo = { default := { toElabInfo := default, lctx := default, expectedType? := default, expr := default, isBinder := default } }
Equations
- Lean.Elab.instInhabitedCommandInfo = { default := { toElabInfo := default } }
- dot: Lean.Elab.TermInfo → Option Lean.Syntax → Option Lean.Expr → Lean.Elab.CompletionInfo
- id: Lean.Syntax → Lake.Name → Bool → Lean.LocalContext → Option Lean.Expr → Lean.Elab.CompletionInfo
- dotId: Lean.Syntax → Lake.Name → Lean.LocalContext → Option Lean.Expr → Lean.Elab.CompletionInfo
- fieldId: Lean.Syntax → Lake.Name → Lean.LocalContext → Lake.Name → Lean.Elab.CompletionInfo
- namespaceId: Lean.Syntax → Lean.Elab.CompletionInfo
- option: Lean.Syntax → Lean.Elab.CompletionInfo
- endSection: Lean.Syntax → List String → Lean.Elab.CompletionInfo
- tactic: Lean.Syntax → List Lean.MVarId → Lean.Elab.CompletionInfo
A completion is an item that appears in the IntelliSense box that appears as you type.
Instances For
- stx : Lean.Syntax
- optionName : Lake.Name
- declName : Lake.Name
Info for an option reference (e.g. in set_option
).
Instances For
- projName : Lake.Name
Name of the projection.
- fieldName : Lake.Name
Name of the field as written.
- lctx : Lean.LocalContext
- val : Lean.Expr
- stx : Lean.Syntax
Instances For
Equations
- Lean.Elab.instInhabitedFieldInfo = { default := { projName := default, fieldName := default, lctx := default, val := default, stx := default } }
- elaborator : Lake.Name
- stx : Lean.Syntax
- mctxBefore : Lean.MetavarContext
- goalsBefore : List Lean.MVarId
- mctxAfter : Lean.MetavarContext
- goalsAfter : List Lean.MVarId
The information needed to render the tactic state in the infoview.
We store the list of goals before and after the execution of a tactic.
We also store the metavariable context at each time since we want metavariables
unassigned at tactic execution time to be displayed as ?m...
.
Instances For
Equations
- Lean.Elab.instInhabitedTacticInfo = { default := { toElabInfo := default, mctxBefore := default, goalsBefore := default, mctxAfter := default, goalsAfter := default } }
- lctx : Lean.LocalContext
- stx : Lean.Syntax
- output : Lean.Syntax
Instances For
Equations
- Lean.Elab.instInhabitedMacroExpansionInfo = { default := { lctx := default, stx := default, output := default } }
- stx : Lean.Syntax
- widgetId : Lake.Name
Id of
WidgetSource
object to use. - props : Lean.Json
Json representing the props to be loaded in to the component.
An info that represents a user-widget.
User-widgets are custom pieces of code that run on the editor client.
You can learn about user widgets at src/Lean/Widget/UserWidget
Instances For
Equations
- Lean.Elab.instInhabitedUserWidgetInfo = { default := { stx := default, widgetId := default, props := default } }
- userName : Lake.Name
- id : Lean.FVarId
- baseId : Lean.FVarId
Specifies that the given free variables should be considered semantically identical.
The free variable baseId
might not be in the current local context
because it has been cleared.
Used for e.g. connecting variables before and after match
generalization.
Instances For
- stx : Lean.Syntax
Contains the syntax of an identifier which is part of a field redeclaration, like:
structure Foo := x : Nat
structure Bar extends Foo :=
x := 0
--^ here
Instances For
- ofTacticInfo: Lean.Elab.TacticInfo → Lean.Elab.Info
- ofTermInfo: Lean.Elab.TermInfo → Lean.Elab.Info
- ofCommandInfo: Lean.Elab.CommandInfo → Lean.Elab.Info
- ofMacroExpansionInfo: Lean.Elab.MacroExpansionInfo → Lean.Elab.Info
- ofOptionInfo: Lean.Elab.OptionInfo → Lean.Elab.Info
- ofFieldInfo: Lean.Elab.FieldInfo → Lean.Elab.Info
- ofCompletionInfo: Lean.Elab.CompletionInfo → Lean.Elab.Info
- ofUserWidgetInfo: Lean.Elab.UserWidgetInfo → Lean.Elab.Info
- ofCustomInfo: Lean.Elab.CustomInfo → Lean.Elab.Info
- ofFVarAliasInfo: Lean.Elab.FVarAliasInfo → Lean.Elab.Info
- ofFieldRedeclInfo: Lean.Elab.FieldRedeclInfo → Lean.Elab.Info
Header information for a node in InfoTree
.
Instances For
Equations
- Lean.Elab.instInhabitedInfo = { default := Lean.Elab.Info.ofTacticInfo default }
- context: Lean.Elab.ContextInfo → Lean.Elab.InfoTree → Lean.Elab.InfoTree
The context object is created by
liftTermElabM
atCommand.lean
- node: Lean.Elab.Info → Lean.PersistentArray Lean.Elab.InfoTree → Lean.Elab.InfoTree
The children contain information for nested term elaboration and tactic evaluation
- hole: Lean.MVarId → Lean.Elab.InfoTree
The elaborator creates holes (aka metavariables) for tactics and postponed terms
The InfoTree is a structure that is generated during elaboration and used by the language server to look up information about objects at particular points in the Lean document. For example, tactic information and expected type information in the infoview and information about completions.
The infotree consists of nodes which may have child nodes. Each node
has an Info
object that contains details about what kind of information
is present. Each Info
object also contains a Syntax
instance, this is used to
map positions in the Lean document to particular info objects.
An example of a function that extracts information from an infotree for a given
position is InfoTree.goalsAt?
which finds TacticInfo
.
Information concerning expressions requires that a context also be saved.
context
nodes store a local context that is used to process expressions
in nodes below.
Because the info tree is generated during elaboration, some parts of the infotree
for a particular piece of syntax may not be ready yet. Hence InfoTree supports metavariable-like
hole
s which are filled in later in the same way that unassigned metavariables are.
Instances For
Equations
- Lean.Elab.instInhabitedInfoTree = { default := Lean.Elab.InfoTree.node default default }
- enabled : Bool
Whether info trees should be recorded.
- assignment : Lean.PersistentHashMap Lean.MVarId Lean.Elab.InfoTree
Map from holes in the infotree to child infotrees.
Pending child trees of a node.
This structure is the state that is being used to build an InfoTree object.
During elaboration, some parts of the info tree may be holes
which need to be filled later.
The assignments
field is used to assign these holes.
The trees
field is a list of pending child trees for the infotree node currently being built.
You should not need to use InfoState
directly, instead infotrees should be built with the help of the methods here
such as pushInfoLeaf
to create leaf nodes and withInfoContext
to create a nested child node.
To see how trees
is used, look at the function body of withInfoContext'
.
Instances For
Equations
- Lean.Elab.instInhabitedInfoState = { default := { enabled := default, assignment := default, trees := default } }
- getInfoState : m Lean.Elab.InfoState
- modifyInfoState : (Lean.Elab.InfoState → Lean.Elab.InfoState) → m Unit
Instances
Equations
- Lean.Elab.instMonadInfoTree = { getInfoState := liftM Lean.Elab.getInfoState, modifyInfoState := fun f => liftM (Lean.Elab.modifyInfoState f) }
Equations
- Lean.Elab.setInfoState s = Lean.Elab.modifyInfoState fun x => s