-
Notifications
You must be signed in to change notification settings - Fork 444
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
can't see goal state after case tactic #2881
Comments
I also stumbled over this, version Consider
The natural thing to do next is to move the cursor to the next line, aligned with the
If I de-indent once more, to
I see what I want to see: The list of still open goals
But de-indenting further left seems wrong here. It does not happen with Maybe the parser for Odd, the parsers for
So not sure why it works for some and not the others. |
example {a b : Nat} (h : a = b) : b ≤ b + 1 := by
suffices a ≤ a + 1 by
/-
a b : Nat
h : a = b
⊢ a ≤ a + 1
-/
sorry
suffices a ≤ a + 1 from by
/-
a b : Nat
h : a = b
this : a ≤ a + 1
⊢ a ≤ a + 1
-/
sorry
simp [h] |
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` 1. 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` 1. 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.
Prerequisites
Description
In the following example, if you put your cursor on the empty line, indented two spaces (i.e. where the next tactic should be), the goal state shows
no goals
(i.e. the goal state of finished casezero
).It should show the goal state of the remaining goal(s).
(note: the same occurs when there is a multi-line tactic block after
case zero
).Context
Zulip thread
Versions
Lean 4.2.0
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: