lean4-htt/tests/lean/run/4534.lean
Marc Huisinga 9d427fdfcf
feat: "try this" messages with support for interactivity (#10524)
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"
/>
2025-10-13 13:39:03 +00:00

20 lines
523 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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]