Repository navigation
fix: show goal of empty nested by block at positions indented past the enclosing tactic - #15095
Merged
Merged
Conversation
…the enclosing tactic This PR fixes the goal view showing the state after `have` instead of the goal of an empty nested `have ... := by` block on the following line, where the next tactic is about to be typed (#15053, regression of #1927 from #13229). The `isEmptyBy` heuristic in `InfoTree.goalsAt?` was removed in #13229 because empty `by` blocks no longer produce `.missing` syntax. Instead of checking for emptiness, `by` blocks and tokens are now flagged as `hangingBy`, and whether they count as indented is decided by the enclosing tactic by comparing the hover column with its own column, which matches where the parser would put a tactic typed at that position. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01UUFnG7QzKo9chq1i9qDkaR
mhuisi
approved these changes
Sep 9, 2026
mhuisi
enabled auto-merge
September 9, 2026 14:18
|
Mathlib CI status (docs):
|
Contributor
|
This doesn't work for example : True := by
induction True.intro with
| intro =>
-- no goals
example : True := by
cases True.intro with
| intro =>
-- no goals
example : True := by
impossible by
-- no goalsthough (put your cursor before the comment). Ideally, it would just show the goal state of the goal that would be affected if you wrote |
Kha
added a commit
that referenced
this pull request
Sep 10, 2026
… at positions indented past the enclosing tactic (#15104) Backport 1163653 from #15095. Co-authored-by: Sebastian Ullrich <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
Contributor
Contributor
|
Yes, the first and second example works properly now! example : False := by
grind =>
-- no goals
example : False := by
sym =>
-- no goals
example : True := by
impossible by
-- no goalsstill don't work though |
Contributor
|
I don't think that these are recent regressions, either. Please feel free to open an issue about these. |
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the goal view showing the state after
haveinstead of the goal of an empty nestedhave ... := byblock on the following line, where the next tactic is about to be typed (#15053, regression of #1927 from #13229).The
isEmptyByheuristic inInfoTree.goalsAt?was removed in #13229 because emptybyblocks no longer produce.missingsyntax. Instead of checking for emptiness,byblocks and tokens are now flagged ashangingBy, and whether they count as indented is decided by the enclosing tactic by comparing the hover column with its own column, which matches where the parser would put a tactic typed at that position.