-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
7 changed files
with
109 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
some | ||
{ | ||
range := | ||
{ pos := { line := 194, column := 42 }, charUtf16 := 42, endPos := { line := 200, column := 31 }, | ||
{ pos := { line := 202, column := 42 }, charUtf16 := 42, endPos := { line := 208, column := 31 }, | ||
endCharUtf16 := 31 }, | ||
selectionRange := | ||
{ pos := { line := 194, column := 46 }, charUtf16 := 46, endPos := { line := 194, column := 58 }, | ||
{ pos := { line := 202, column := 46 }, charUtf16 := 46, endPos := { line := 202, column := 58 }, | ||
endCharUtf16 := 58 } } |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
example (n : Nat) : True := by | ||
induction n | ||
case zero => sorry -- `zero` goal | ||
--^ $/lean/plainGoal | ||
|
||
example (n : Nat) : True := by | ||
induction n | ||
case zero => sorry | ||
-- `succ` goal | ||
--^ $/lean/plainGoal | ||
|
||
example (n : Nat) : True := by | ||
induction n | ||
case' zero => sorry -- `zero` goal | ||
--^ $/lean/plainGoal | ||
|
||
example (n : Nat) : True := by | ||
induction n | ||
case' zero => sorry | ||
-- `succ` goal | ||
--^ $/lean/plainGoal | ||
|
||
example (n : Nat) : True := by | ||
induction n | ||
next => sorry -- `zero` goal | ||
--^ $/lean/plainGoal | ||
|
||
example (n : Nat) : True := by | ||
induction n | ||
next => sorry | ||
-- `succ` goal | ||
--^ $/lean/plainGoal | ||
|
||
example (n : Nat) : True := by | ||
induction n with | ||
| zero => sorry -- `zero` goal | ||
--^ $/lean/plainGoal | ||
|
||
example (n : Nat) : True := by | ||
induction n with | ||
| zero => sorry | ||
-- General goal | ||
--^ $/lean/plainGoal | ||
|
||
example : True := by | ||
suffices True by | ||
-- Goal assuming `True` | ||
--^ $/lean/plainGoal | ||
sorry |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{"textDocument": {"uri": "file:///2881.lean"}, | ||
"position": {"line": 2, "character": 3}} | ||
{"rendered": "```lean\n⊢ True\n```", "goals": ["⊢ True"]} | ||
{"textDocument": {"uri": "file:///2881.lean"}, | ||
"position": {"line": 8, "character": 2}} | ||
{"rendered": "```lean\ncase succ\nn✝ : Nat\na✝ : True\n⊢ True\n```", | ||
"goals": ["case succ\nn✝ : Nat\na✝ : True\n⊢ True"]} | ||
{"textDocument": {"uri": "file:///2881.lean"}, | ||
"position": {"line": 13, "character": 3}} | ||
{"rendered": "```lean\ncase zero\n⊢ True\n```", "goals": ["case zero\n⊢ True"]} | ||
{"textDocument": {"uri": "file:///2881.lean"}, | ||
"position": {"line": 19, "character": 2}} | ||
{"rendered": "```lean\ncase succ\nn✝ : Nat\na✝ : True\n⊢ True\n```", | ||
"goals": ["case succ\nn✝ : Nat\na✝ : True\n⊢ True"]} | ||
{"textDocument": {"uri": "file:///2881.lean"}, | ||
"position": {"line": 24, "character": 3}} | ||
{"rendered": "```lean\n⊢ True\n```", "goals": ["⊢ True"]} | ||
{"textDocument": {"uri": "file:///2881.lean"}, | ||
"position": {"line": 30, "character": 2}} | ||
{"rendered": "```lean\ncase succ\nn✝ : Nat\na✝ : True\n⊢ True\n```", | ||
"goals": ["case succ\nn✝ : Nat\na✝ : True\n⊢ True"]} | ||
{"textDocument": {"uri": "file:///2881.lean"}, | ||
"position": {"line": 35, "character": 3}} | ||
{"rendered": "```lean\ncase zero\n⊢ True\n```", "goals": ["case zero\n⊢ True"]} | ||
{"textDocument": {"uri": "file:///2881.lean"}, | ||
"position": {"line": 41, "character": 2}} | ||
{"rendered": "```lean\nn : Nat\n⊢ True\n```", "goals": ["n : Nat\n⊢ True"]} | ||
{"textDocument": {"uri": "file:///2881.lean"}, | ||
"position": {"line": 46, "character": 4}} | ||
{"rendered": "```lean\nthis : True\n⊢ True\n```", | ||
"goals": ["this : True\n⊢ True"]} |