Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: getInteractiveDiagnostics off-by-one error (#3608)
This bug is the real cause of leanprover/vscode-lean4#392. At the end of a tactic state, the client calls `getInteractiveDiagnostics` with a range `[last line of proof, last line of proof + 1)`. The `fullRange` span of the `unresolved goals` error however is something like `[(first line of proof, start character), (last line of proof, nonzero end character)). Since it operates on line numbers, `getInteractiveDiagnostics` would then check whether `[last line of proof, last line of proof + 1)` and `[first line of proof, last line of proof)` intersect, which is false because of the excluded upper bound on the latter interval, despite the fact that the end character in the last line may be nonzero. This fix adjusts the intersection logic to use `[first line of proof, last line of proof]` if the end character is nonzero. Closes leanprover/vscode-lean4#392.
- Loading branch information