This PR adjusts the "try this" widget to be rendered as a widget message under 'Messages', not a separate widget under a 'Suggestions' section. The main benefit of this is that the message of the widget is not duplicated between 'Messages' and 'Suggestions'. Since widget message suggestions were already implemented by @jrr6 for the new hint infrastructure, this PR replaces the old "try this" implementation with the new hint infrastructure. In doing so, the `style?` field of suggestions is deprecated, since the hint infrastructure highlights hints using diff colors, and `style?` also never saw much use downstream. Additionally, since the message and the suggestion are now the same component, the `messageData?` field of suggestions is deprecated as well. Notably, the "Try this:" message string now also contains a newline and indentation to separate the suggestion from the rest of the message more clearly and the `postInfo?` field of the suggestion is now part of the message. Finally, this PR changes the diff colors used by the hint infrastructure to be more color-blindness-friendly (insertions are now blue, not green, and text that remains unchanged is now using the editor foreground color instead of blue). ### Breaking changes Tests that use `#guard_msgs` to test the "Try this:" message may need to be adjusted for the new formatting of the message.
55 lines
1.7 KiB
Text
55 lines
1.7 KiB
Text
/--
|
|
info: Try these:
|
|
• simp +arith
|
|
• simp +arith +decide
|
|
---
|
|
error: `simp_arith` has been deprecated. It was a shorthand for `simp +arith +decide`, but most of the time, `+decide` was redundant since simprocs have been implemented.
|
|
-/
|
|
#guard_msgs in
|
|
example : x + 2 = 1 + 1 + x := by
|
|
simp_arith
|
|
|
|
/--
|
|
info: Try these:
|
|
• simp +arith [h, id] at h₂
|
|
• simp +arith +decide [h, id] at h₂
|
|
---
|
|
error: `simp_arith` has been deprecated. It was a shorthand for `simp +arith +decide`, but most of the time, `+decide` was redundant since simprocs have been implemented.
|
|
-/
|
|
#guard_msgs in
|
|
example (h : x = y) (h₂ : y + 2 = 1 + 1 + x) : True := by
|
|
simp_arith [h, id] at h₂
|
|
|
|
/--
|
|
info: Try these:
|
|
• simp! +arith [h, id] at h₂
|
|
• simp! +arith +decide [h, id] at h₂
|
|
---
|
|
error: `simp_arith!` has been deprecated. It was a shorthand for `simp! +arith +decide`, but most of the time, `+decide` was redundant since simprocs have been implemented.
|
|
-/
|
|
#guard_msgs in
|
|
example (h : x = y) (h₂ : y + 2 = 1 + 1 + x) : True := by
|
|
simp_arith! [h, id] at h₂
|
|
|
|
|
|
/--
|
|
info: Try these:
|
|
• simp_all +arith
|
|
• simp_all +arith +decide
|
|
---
|
|
error: `simp_all_arith` has been deprecated. It was a shorthand for `simp_all +arith +decide`, but most of the time, `+decide` was redundant since simprocs have been implemented.
|
|
-/
|
|
#guard_msgs in
|
|
example (h : x = y) (h₂ : y + 2 = 1 + 1 + x) : True := by
|
|
simp_all_arith
|
|
|
|
/--
|
|
info: Try these:
|
|
• simp_all! +arith
|
|
• simp_all! +arith +decide
|
|
---
|
|
error: `simp_all_arith!` has been deprecated. It was a shorthand for `simp_all! +arith +decide`, but most of the time, `+decide` was redundant since simprocs have been implemented.
|
|
-/
|
|
#guard_msgs in
|
|
example (h : x = y) (h₂ : y + 2 = 1 + 1 + x) : True := by
|
|
simp_all_arith!
|