mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 05:14:52 +00:00
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:
parent
12c337c948
commit
a3ec8ca9df
11 changed files with 53 additions and 63 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue