aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/diagnostics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/diagnostics.rs')
-rw-r--r--crates/ide/src/diagnostics.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs
index a43188fb0..2e5395b51 100644
--- a/crates/ide/src/diagnostics.rs
+++ b/crates/ide/src/diagnostics.rs
@@ -13,7 +13,7 @@ use hir::{
13 diagnostics::{Diagnostic as _, DiagnosticCode, DiagnosticSinkBuilder}, 13 diagnostics::{Diagnostic as _, DiagnosticCode, DiagnosticSinkBuilder},
14 Semantics, 14 Semantics,
15}; 15};
16use ide_db::{base_db::SourceDatabase, source_change::SourceFileEdits, RootDatabase}; 16use ide_db::{base_db::SourceDatabase, RootDatabase};
17use itertools::Itertools; 17use itertools::Itertools;
18use rustc_hash::FxHashSet; 18use rustc_hash::FxHashSet;
19use syntax::{ 19use syntax::{
@@ -219,7 +219,7 @@ fn check_unnecessary_braces_in_use_statement(
219 Diagnostic::hint(use_range, "Unnecessary braces in use statement".to_string()) 219 Diagnostic::hint(use_range, "Unnecessary braces in use statement".to_string())
220 .with_fix(Some(Fix::new( 220 .with_fix(Some(Fix::new(
221 "Remove unnecessary braces", 221 "Remove unnecessary braces",
222 SourceFileEdits::from_text_edit(file_id, edit).into(), 222 SourceChange::from_text_edit(file_id, edit),
223 use_range, 223 use_range,
224 ))), 224 ))),
225 ); 225 );
@@ -264,10 +264,10 @@ mod tests {
264 .unwrap(); 264 .unwrap();
265 let fix = diagnostic.fix.unwrap(); 265 let fix = diagnostic.fix.unwrap();
266 let actual = { 266 let actual = {
267 let file_id = *fix.source_change.source_file_edits.edits.keys().next().unwrap(); 267 let file_id = *fix.source_change.source_file_edits.keys().next().unwrap();
268 let mut actual = analysis.file_text(file_id).unwrap().to_string(); 268 let mut actual = analysis.file_text(file_id).unwrap().to_string();
269 269
270 for edit in fix.source_change.source_file_edits.edits.values() { 270 for edit in fix.source_change.source_file_edits.values() {
271 edit.apply(&mut actual); 271 edit.apply(&mut actual);
272 } 272 }
273 actual 273 actual
@@ -613,9 +613,7 @@ fn test_fn() {
613 Fix { 613 Fix {
614 label: "Create module", 614 label: "Create module",
615 source_change: SourceChange { 615 source_change: SourceChange {
616 source_file_edits: SourceFileEdits { 616 source_file_edits: {},
617 edits: {},
618 },
619 file_system_edits: [ 617 file_system_edits: [
620 CreateFile { 618 CreateFile {
621 dst: AnchoredPathBuf { 619 dst: AnchoredPathBuf {