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: some goal state issues #5677

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mhuisi
Copy link
Contributor

@mhuisi mhuisi commented Oct 11, 2024

This PR resolves the following issues related to goal state display:

  1. In a new line after a case tactic with a completed proof, the state of the proof in the case would be displayed, not the proof state after the case
  2. In the range of next => / case' ... =>, the state of the proof in the corresponding case would not be displayed, whereas this is true for case
  3. In the suffices ... by tactic, the tactic state of the by block was not displayed after the by and before the first tactic

The incorrect goal state after case was caused by evalCase adding a TacticInfo with the full block proof state for the full range of the case block that the goal state selection has no means of distinguishing from the TacticInfo with the same range that contains the state after the whole case block. Narrowing the range of this TacticInfo to case ... => fixed this issue.

The lack of a case proof state on next => was caused by the case syntax that next expands to receiving noncanonical synthetic SourceInfo, which is usually ignored by the language server. Adding a token antiquotation for next fixed this issue.

The lack of a case proof state on case' ... => was caused by evalCase' not adding a TacticInfo with the full block state to the range of case' ... =>. Adding this TacticInfo fixed this issue.

The tactic state of the block not being displayed after the by was caused by the macro expansion of suffices to have not transferring the trailing whitespace of the by. Ensuring that this trailing whitespace information is transferred fixed this issue.

Fixes #2881.

@mhuisi mhuisi requested a review from Kha October 11, 2024 14:53
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Oct 11, 2024
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Oct 11, 2024

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 3930100b67d2dd14a62412432f8822b29a9900af --onto d10d41bc07942ca6d8f3081a637045321db15c5a. (2024-10-11 15:11:41)
  • ✅ Mathlib branch lean-pr-testing-5677 has successfully built against this PR. (2024-10-11 16:39:41) View Log

@mhuisi mhuisi force-pushed the mhuisi/state-after-case-tactic branch from 1ccdad1 to e4a8f50 Compare October 11, 2024 15:12
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Oct 11, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Oct 11, 2024
@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR 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.

can't see goal state after case tactic
2 participants