Initial setup for code action attributes #
-
Attribute
@[hole_code_action]
collects code actions which will be called on each occurrence of a hole (_
,?_
orsorry
). -
Attribute
@[tactic_code_action]
collects code actions which will be called on each occurrence of a tactic. -
Attribute
@[command_code_action]
collects code actions which will be called on each occurrence of a command.
A hole code action extension.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Read a hole code action from a declaration of the right type.
Equations
- Std.CodeAction.mkHoleCodeAction n = do let __discr ← read match __discr with | { env := env, opts := opts } => liftM (IO.ofExcept (Std.CodeAction.mkHoleCodeAction.impl✝ n env opts))
Instances For
An extension which collects all the hole code actions.
A tactic code action extension.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A tactic code action extension.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Read a tactic code action from a declaration of the right type.
Equations
- Std.CodeAction.mkTacticCodeAction n = do let __discr ← read match __discr with | { env := env, opts := opts } => liftM (IO.ofExcept (Std.CodeAction.mkTacticCodeAction.impl✝ n env opts))
Instances For
Read a tacticSeq code action from a declaration of the right type.
Equations
- One or more equations did not get rendered due to their size.
Instances For
An entry in the tactic code actions extension, containing the attribute arguments.
- declName : Lean.Name
The declaration to tag
The tactic kinds that this extension supports. If empty it is called on all tactic kinds.
Instances For
Equations
- Std.CodeAction.instInhabitedTacticCodeActionEntry = { default := { declName := default, tacticKinds := default } }
The state of the tactic code actions extension.
- onAnyTactic : Array Std.CodeAction.TacticCodeAction
The list of tactic code actions to apply on any tactic.
- onTactic : Lean.NameMap (Array Std.CodeAction.TacticCodeAction)
The list of tactic code actions to apply when a particular tactic kind is highlighted.
Instances For
Equations
- Std.CodeAction.instInhabitedTacticCodeActions = { default := { onAnyTactic := default, onTactic := default } }
Insert a tactic code action entry into the TacticCodeActions
structure.
Equations
- One or more equations did not get rendered due to their size.
Instances For
An extension which collects all the tactic code actions.
An extension which collects all the tactic code actions.
This attribute marks a code action, which is used to suggest new tactics or replace existing ones.
-
@[tactic_code_action]
: This is a code action which applies to the spaces between tactics, to suggest a new tactic to change the goal state. -
@[tactic_code_action kind]
: This is a code action which applies to applications of the tactickind
(a tactic syntax kind), which can replace the tactic or insert things before or after it. -
@[tactic_code_action kind₁ kind₂]
: shorthand for@[tactic_code_action kind₁, tactic_code_action kind₂]
. -
@[tactic_code_action *]
: This is a tactic code action that applies to all tactics. Use sparingly.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A command code action extension.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Read a command code action from a declaration of the right type.
Equations
- Std.CodeAction.mkCommandCodeAction n = do let __discr ← read match __discr with | { env := env, opts := opts } => liftM (IO.ofExcept (Std.CodeAction.mkCommandCodeAction.impl✝ n env opts))
Instances For
An entry in the command code actions extension, containing the attribute arguments.
- declName : Lean.Name
The declaration to tag
The command kinds that this extension supports. If empty it is called on all command kinds.
Instances For
Equations
- Std.CodeAction.instInhabitedCommandCodeActionEntry = { default := { declName := default, cmdKinds := default } }
The state of the command code actions extension.
- onAnyCmd : Array Std.CodeAction.CommandCodeAction
The list of command code actions to apply on any command.
The list of command code actions to apply when a particular command kind is highlighted.
Instances For
Equations
- Std.CodeAction.instInhabitedCommandCodeActions = { default := { onAnyCmd := default, onCmd := default } }
Insert a command code action entry into the CommandCodeActions
structure.
Equations
- One or more equations did not get rendered due to their size.
Instances For
An extension which collects all the command code actions.
This attribute marks a code action, which is used to suggest new tactics or replace existing ones.
-
@[command_code_action kind]
: This is a code action which applies to applications of the commandkind
(a command syntax kind), which can replace the command or insert things before or after it. -
@[command_code_action kind₁ kind₂]
: shorthand for@[command_code_action kind₁, command_code_action kind₂]
. -
@[command_code_action]
: This is a command code action that applies to all commands. Use sparingly.
Equations
- One or more equations did not get rendered due to their size.