Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lsp): renderDiagnostic and explainError stop searching early
Cursor positions are (1,0)-indexed but recursively searching was using the previous diagnostic's position directly, which is (0,0)-indexed. This meant that if the first examined diagnostic did not have a diagnostic code or a rendered error we would search from the previous line and immediately look at the current diagnostic again. So we would fallback to the first possible error/diagnostic, even if there was one further in the file that could be used instead. We now convert the diagnostic position back into a cursor position (just increment the line number) before getting the next diagnostic so we continue the search from the correct place.
- Loading branch information