Remove Diagnostic::expect_range and all consumers (#20322)

Replace usage with `range().unwrap_or_default()` or more appropriate
alternatives based on context.
This commit is contained in:
Amethyst Reese 2025-09-10 17:19:20 -07:00 committed by GitHub
parent 12c337c948
commit a3ec8ca9df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 53 additions and 63 deletions

View file

@ -234,7 +234,7 @@ fn to_lsp_diagnostic(
index: &LineIndex,
encoding: PositionEncoding,
) -> (usize, lsp_types::Diagnostic) {
let diagnostic_range = diagnostic.expect_range();
let diagnostic_range = diagnostic.range().unwrap_or_default();
let name = diagnostic.name();
let body = diagnostic.body().to_string();
let fix = diagnostic.fix();