Skip to content

fix: restore trailing whitespace of nested tactic blocks in the info tree - #15093

Merged
Kha merged 1 commit into
masterfrom
info-tree-add-trailing
Sep 10, 2026
Merged

Kha merged 1 commit into
masterfrom
info-tree-add-trailing

Conversation

@Kha

@Kha Kha commented Sep 9, 2026

Copy link
Copy Markdown
Member

This PR fixes the goal view showing the state after the enclosing tactic instead of the nested block's goal on the line after the last tactic of a nested have ... := by block or · bullet, e.g. after an empty · where the next tactic is about to be typed (#15053).

Tactic steps are elaborated without the trailing whitespace of their last token for incremental reuse (#11958), which is re-added to the resulting info trees afterwards. InfoTree.addTrailing? passed each node's own trailing whitespace to its children instead of the trailing being added, which cut off propagation at the by token node that have ... := by tacs expands to via with_annotate_state, so the last nested tactic never regained its whitespace. Term-level blocks ending a tactic step additionally hide behind an unsubstituted info hole at that point, so evalSepTactics now substitutes holes before re-adding.

…tree

This PR fixes the goal view showing the state after the enclosing tactic instead of the nested block's goal on the line after the last tactic of a nested `have ... := by` block or `·` bullet, e.g. after an empty `·` where the next tactic is about to be typed (#15053).

Tactic steps are elaborated without the trailing whitespace of their last token for incremental reuse (#11958), which is re-added to the resulting info trees afterwards. `InfoTree.addTrailing?` passed each node's own trailing whitespace to its children instead of the trailing being added, which cut off propagation at the `by` token node that `have ... := by tacs` expands to via `with_annotate_state`, so the last nested tactic never regained its whitespace. Term-level blocks ending a tactic step additionally hide behind an unsubstituted info hole at that point, so `evalSepTactics` now substitutes holes before re-adding.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UUFnG7QzKo9chq1i9qDkaR
@Kha

Kha commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

leanprover-radar commented Sep 9, 2026 •

Copy link
Copy Markdown

Benchmark results for 4481b18 against c155094 are in. No significant results found. @Kha

  • 🟥 build//instructions: +234.9M (+0.00%)

Small changes (1✅)

  • ✅ build/module/Lean.Elab.InfoTree.Basic//instructions: -11.1M (-0.61%)

@github-actions github-actions Bot added toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN labels Sep 9, 2026
@Kha
Kha marked this pull request as ready for review September 9, 2026 13:44
@Kha
Kha requested a review from kim-em as a code owner September 9, 2026 13:44
@Kha
Kha enabled auto-merge September 9, 2026 13:44
@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Sep 9, 2026
@mathlib-lean-pr-testing

Copy link
Copy Markdown

Mathlib CI status (docs):

@Kha Kha added the changelog-server Language server, widgets, and IDE extensions label Sep 10, 2026
@Kha
Kha added this pull request to the merge queue Sep 10, 2026
Merged via the queue into master with commit 843c831 Sep 10, 2026
39 of 41 checks passed
Kha added a commit that referenced this pull request Sep 14, 2026
…d tactic blocks in the info tree (#15106)

Backport 843c831 from #15093.

Co-authored-by: Sebastian Ullrich <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport releases/v4.34.0 builds-mathlib CI has verified that Mathlib builds against this PR changelog-server Language server, widgets, and IDE extensions mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN 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.

2 participants