Refactor Fix and Edit API (#4198)

This commit is contained in:
Zanie Adkins 2023-05-08 04:57:03 -05:00 committed by GitHub
parent edaf891042
commit 0801f14046
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
102 changed files with 529 additions and 398 deletions

View file

@ -33,7 +33,7 @@ use ruff_python_ast::source_code::{SourceFile, SourceLocation};
pub struct Message {
pub kind: DiagnosticKind,
pub range: TextRange,
pub fix: Fix,
pub fix: Option<Fix>,
pub file: SourceFile,
pub noqa_offset: TextSize,
}
@ -191,10 +191,10 @@ def fibonacci(n):
},
TextRange::new(TextSize::from(94), TextSize::from(95)),
)
.with_fix(Fix::new(vec![Edit::deletion(
.with_fix(Fix::unspecified(Edit::deletion(
TextSize::from(94),
TextSize::from(99),
)]));
)));
let file_2 = r#"if a == 1: pass"#;