You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Trace nodes do not nest correctly in the infoview #6389
Expected behavior: Trace nodes are properly nested, as they are on the command line / in #guard_msgs:
[foo] Foo
[bar] Bar 1
[baz] Baz
Log message
[bar] Bar 2
Log message
Actual behavior: Infoview shows [baz] is incorrectly nested, and everything beneath it would also truncate to a two-space indent, no matter how deeply nested.
Reacted by Joachim Breitner, Kevin Buzzard, blizzard_inc, Junyan Xu, Michael Stoll, Michael Rothgang, Alok Singh, Kim Morrison, Julian Berman, Patrick Massot and 1 more
--- a/src/Lean/Widget/InteractiveDiagnostic.lean+++ b/src/Lean/Widget/InteractiveDiagnostic.lean@@ -175,7 +175,9 @@ where
else
pure (.strict (← children.mapM (go nCtx ctx)))
let e := .trace data.cls header data.collapsed nodes
- return .tag (← pushEmbed e) default+ -- Trace nodes occupy a full line in the widget view, so ensure the formatter considers them+ -- as such.+ return .nest 2 <| .tag (← pushEmbed e) "\n"
which ensures that the TaggedText actually populates the indent correctly; but then the infoview seems to insert extra newlines and indents.
As a workaround when using set_option trace.Meta.synthInstance true, you can use #guard_msgs to force the trace to be rendered as correctly-indented text.
Activity
eric-wieser commentedon Dec 15, 2024
This (mostly) worked in Lean 4.8.0, where the infoview output is:
The bug appeared in 4.9.0.
(This also hopefully exonerates the vscode extension, since the latest extension works ok with old Lean 4.8.0)
eric-wieser commentedon Dec 15, 2024
I experimented with a patch along the lines of
which ensures that the
TaggedTextactually populates the indent correctly; but then the infoview seems to insert extra newlines and indents.eric-wieser commentedon Dec 23, 2024
As a workaround when using
set_option trace.Meta.synthInstance true, you can use#guard_msgsto force the trace to be rendered as correctly-indented text.fix: trace indentation in info view (#6597)
fix: trace indentation in info view (leanprover#6597)
fix: trace indentation in info view (leanprover#6597)