From 0063f03e86f4222a5027720142eb20db4adc485d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 21 Dec 2018 11:24:16 +0300 Subject: hide atom edits a bit --- crates/ra_analysis/src/imp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_analysis/src/imp.rs') diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index cefe5a748..a7be56f5a 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs @@ -520,7 +520,7 @@ impl SourceChange { pub(crate) fn from_local_edit(file_id: FileId, label: &str, edit: LocalEdit) -> SourceChange { let file_edit = SourceFileEdit { file_id, - edits: edit.edit.into_atoms(), + edit: edit.edit, }; SourceChange { label: label.to_string(), -- cgit v1.2.3 From b5b44659a42cf982590519317ede9ead354f9c4e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 21 Dec 2018 12:18:14 +0300 Subject: edits use source-root API --- crates/ra_analysis/src/imp.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'crates/ra_analysis/src/imp.rs') diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index a7be56f5a..5701e1ae2 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs @@ -368,10 +368,11 @@ impl AnalysisImpl { .collect::>(); if let Some(m) = source_binder::module_from_file_id(&*self.db, file_id)? { for (name_node, problem) in m.problems(&*self.db) { + let source_root = self.db.file_source_root(file_id); let diag = match problem { Problem::UnresolvedModule { candidate } => { let create_file = FileSystemEdit::CreateFile { - anchor: file_id, + source_root, path: candidate.clone(), }; let fix = SourceChange { @@ -388,11 +389,12 @@ impl AnalysisImpl { } Problem::NotDirOwner { move_to, candidate } => { let move_file = FileSystemEdit::MoveFile { - file: file_id, - path: move_to.clone(), + src: file_id, + dst_source_root: source_root, + dst_path: move_to.clone(), }; let create_file = FileSystemEdit::CreateFile { - anchor: file_id, + source_root, path: move_to.join(candidate), }; let fix = SourceChange { -- cgit v1.2.3