lean4-htt/tests/lean/run/show_term.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

32 lines
570 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.

/-
Copyright (c) 2021 Kim Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kim Morrison
-/
/--
info: Try this:
[apply] exact (n, 37)
-/
#guard_msgs in example (n : Nat) : Nat × Nat := by
show_term
constructor
exact n
exact 37
/--
info: Try this:
[apply] refine (?_, ?_)
-/
#guard_msgs in example : Nat × Nat := by
show_term constructor
repeat exact 42
/--
info: Try this:
[apply] fun {X} => X
-/
#guard_msgs in example : {_a : Nat} → Nat :=
show_term by
intro X
exact X