This PR adds support for interactivity to the combined "try this" messages that were introduced in #9966. In doing so, it moves the link to apply a suggestion to a separate `[apply]` button in front of the suggestion. Hints with diffs remain unchanged, as they did not previously support interacting with terms in the diff, either. <img width="379" height="256" alt="Suggestion with interactive message" src="https://github.com/user-attachments/assets/7838ebf6-0613-46e7-bc88-468a05acbf51" />
20 lines
523 B
Text
20 lines
523 B
Text
universe u
|
||
|
||
class MyClass (α : Type u) extends LE α where
|
||
sup : α → α → α
|
||
le_refl : ∀ a : α, a ≤ a
|
||
sup_of_le_left : ∀ a b : α, b ≤ a → sup a b = a
|
||
|
||
instance : MyClass Prop where
|
||
le p q := p → q
|
||
sup p q := p ∨ q
|
||
le_refl _ := id
|
||
sup_of_le_left _ _ h := propext ⟨Or.rec id h, Or.inl⟩
|
||
|
||
/--
|
||
info: Try this:
|
||
[apply] simp only [MyClass.le_refl, MyClass.sup_of_le_left]
|
||
-/
|
||
#guard_msgs in
|
||
example : MyClass.sup False False = False := by
|
||
simp? [MyClass.sup_of_le_left, MyClass.le_refl]
|