-
Notifications
You must be signed in to change notification settings - Fork 465
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
Conversation
This only impacts the message, not the widget.
changelog-language |
Mathlib CI status (docs):
|
Thanks! Before merging: Did you make sure that it still looks correct in the InfoView in VSCode? (The rendering of message data sometimes differs between the info view and text output like this, and we certainly want to prioritize the InfoView display.) |
I believe the infoview is handled by |
@@ -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? |
There was a problem hiding this comment.
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.
This PR fixes the indentation of "Try this" suggestions in widget-less multiline messages, as they appear in
#guard_msgs
outputs.