Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing indents in Try this message #7191

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Lean/Meta/Tactic/TryThis.lean
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def addSuggestions (ref : Syntax) (suggestions : Array Suggestion)
(codeActionPrefix? : Option String := none) : MetaM Unit := do
if suggestions.isEmpty then throwErrorAt ref "no suggestions available"
let msgs := suggestions.map toMessageData
let msgs := msgs.foldl (init := MessageData.nil) (fun msg m => msg ++ m!"\n• " ++ m)
let msgs := msgs.foldl (init := MessageData.nil) (fun msg m => msg ++ m!"\n• " ++ .nest 2 m)
logInfoAt ref m!"{header}{msgs}"
addSuggestionCore ref suggestions header (isInline := false) origSpan? style? codeActionPrefix?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nomeata: this line is the one that produces the widget, and it doesn't use msgs at all.

In fact I think the rendering of the widget is subtly wrong in an unrelated way, but arguably that's out of scope for this PR.


Expand Down
7 changes: 3 additions & 4 deletions tests/lean/run/grind_try_trace.lean
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,9 @@ example (as : List α) (a : α) : concat as a = as ++ [a] := by
/--
info: Try these:
• (fun_induction concat) <;> simp_all
• ·
fun_induction concat
· simp
· simp [*]
• · fun_induction concat
· simp
· simp [*]
-/
#guard_msgs (info) in
example (as : List α) (a : α) : concat as a = as ++ [a] := by
Expand Down
Loading