feat: Extend the match code action to also show an implicit-arguments code action#1693
Conversation
…action when it makes sense.
|
Wouldn't it be better to generate this? def myfun4 (t : TermWithImplicit F α) : Nat := by
match t with
| .var x => _
| .func (l := l) f ts => _ |
|
I don't really like how the However it also breaks as soon as one renames in the definition |
|
How about |
|
Then one has to copy a bunch of more names before one can get on with the writing. |
|
After thinking about it some more and not receiving much opinions on zulip i think the best way forward is your original suggestion of def myfun4 (t : TermWithImplicit F α) : Nat := by
match t with
| .var x => _
| .func (l := l) f ts => _The long lines argument isn't really valid since with this syntax one would be expected to delete unneeded args. i have adapted the description and the doc comments accordingly. |
This PR extends the match code action, to also show a new Option
in those cases where at least one constructor might be interesting to use with
@.Here
interestingis defined ashas at least one implicit argument that is not a parameter of the inductive type,where a
parameterisan argument to the inductive type that is fixed over constructors.E.g. invoking
Generate a list of equations with implicit arguments for this match.inthe following
produces
where the implicit argument
{l : Nat}is now usable.Note that the arguments
Fandαare not filled since they areparameters(a parameter is an argument to an inductive type that is fixed over constructors), i.e.
they are already determined by the match discriminant
t. This means they don't provide anynew information for you.