-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cdot parser error message range (#4528)
as #4527 describes there is inconsistency between `by`, `case` and `next` on the one hand who, if the goal isn’t closed, put squiggly underlines on the first line, and `.`, which so far only squiggled the dot (which is a very short symbol!) With this change the same mechanism as used by `case`, namely `withCaseRef`, is also used for `.`. There is an argument for the status quo: The `.` tactic is more commonly used with further tactics on the same line, and thus there is now a higher risk that the user might think that the first tactic is broken. But * the same argument does apply to `by` and `case` where there was an intentional choice to do it this way * consistency and * a squiggly line just under the short `.` is easy to miss, so it is actually better to underlining more here (at least until we have a better way to indicate incomplete proofs, which I have hopes for) Fixes #4527, at least most of it.
- Loading branch information
Showing
5 changed files
with
21 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
example : True := by | ||
. skip | ||
--^ collectDiagnostics | ||
skip | ||
-- foo |
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,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}}}]} |
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