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

Conversation

eric-wieser
Copy link
Contributor

@eric-wieser eric-wieser commented Feb 22, 2025

This PR fixes the indentation of "Try this" suggestions in widget-less multiline messages, as they appear in #guard_msgs outputs.

This only impacts the message, not the widget.
@eric-wieser
Copy link
Contributor Author

changelog-language

@github-actions github-actions bot added changelog-language Language features, tactics, and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN labels Feb 22, 2025
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 1ae084b5f81de4326c21431709d5fba396d5276f --onto 2960b384af1f29f566f59a3ede8ac982e4628f19. (2025-02-22 19:59:28)

@nomeata
Copy link
Collaborator

nomeata commented Feb 25, 2025

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.)

@eric-wieser
Copy link
Contributor Author

I believe the infoview is handled by addSuggestionCore, and this PR does not affect how that function is called.

@@ -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.

@Kha Kha added this pull request to the merge queue Feb 25, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 25, 2025
@Kha Kha added this pull request to the merge queue Feb 25, 2025
Merged via the queue into leanprover:master with commit 115f06c Feb 25, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-language Language features, tactics, and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants