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: cdot parser error message range #4528

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Lean/Elab/Tactic/BuiltinTactic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def evalTacticCDot : Tactic := fun stx => do
-- but the token antiquotation does not copy trailing whitespace, leading to
-- differences in the goal display (#2153)
let initInfo ← mkInitialTacticInfo stx[0]
withRef stx[0] <| closeUsingOrAdmit do
withCaseRef stx[0] stx[1] <| closeUsingOrAdmit do
-- save state before/after entering focus on `·`
withInfoContext (pure ()) initInfo
Term.withNarrowedArgTacticReuse (argIdx := 1) evalTactic stx
Expand Down
5 changes: 5 additions & 0 deletions tests/lean/interactive/issue4527.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
example : True := by
. skip
--^ collectDiagnostics
skip
-- foo
10 changes: 10 additions & 0 deletions tests/lean/interactive/issue4527.lean.expected.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{"version": 1,
"uri": "file:///issue4527.lean",
"diagnostics":
[{"source": "Lean 4",
"severity": 1,
"range":
{"start": {"line": 1, "character": 2}, "end": {"line": 2, "character": 0}},
"message": "unsolved goals\n⊢ True",
"fullRange":
{"start": {"line": 1, "character": 2}, "end": {"line": 3, "character": 8}}}]}
6 changes: 3 additions & 3 deletions tests/lean/refineFiltersOldMVars.lean.expected.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ h : Type
case a
⊢ Type
refineFiltersOldMVars.lean:66:4-66:11: error: no goals to be solved
refineFiltersOldMVars.lean:101:2-101:3: error: unsolved goals
refineFiltersOldMVars.lean:101:2-101:13: error: unsolved goals
case d
⊢ Bool
refineFiltersOldMVars.lean:102:2-102:3: error: unsolved goals
refineFiltersOldMVars.lean:102:2-102:13: error: unsolved goals
case e
⊢ Nat
refineFiltersOldMVars.lean:109:2-109:3: error: unsolved goals
refineFiltersOldMVars.lean:109:2-109:13: error: unsolved goals
case e
⊢ Bool
4 changes: 2 additions & 2 deletions tests/lean/tacUnsolvedGoalsErrors.lean.expected.out
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ p q r : Prop
h2 : p → q
h✝ : q
⊢ q
tacUnsolvedGoalsErrors.lean:26:2-26:3: error: unsolved goals
tacUnsolvedGoalsErrors.lean:26:2-27:8: error: unsolved goals
case inl
p q r : Prop
h2 : p → q
h✝ : p
⊢ q
tacUnsolvedGoalsErrors.lean:28:2-28:3: error: unsolved goals
tacUnsolvedGoalsErrors.lean:28:2-29:8: error: unsolved goals
case inr
p q r : Prop
h2 : p → q
Expand Down
Loading