aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-21 09:18:14 +0000
committerAleksey Kladov <[email protected]>2018-12-21 09:18:14 +0000
commitb5b44659a42cf982590519317ede9ead354f9c4e (patch)
tree460d82184faa07256e77cf8b353e135f2b935d1e /crates/ra_analysis/src
parent0063f03e86f4222a5027720142eb20db4adc485d (diff)
edits use source-root API
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r--crates/ra_analysis/src/imp.rs10
-rw-r--r--crates/ra_analysis/src/lib.rs7
2 files changed, 10 insertions, 7 deletions
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 {
368 .collect::<Vec<_>>(); 368 .collect::<Vec<_>>();
369 if let Some(m) = source_binder::module_from_file_id(&*self.db, file_id)? { 369 if let Some(m) = source_binder::module_from_file_id(&*self.db, file_id)? {
370 for (name_node, problem) in m.problems(&*self.db) { 370 for (name_node, problem) in m.problems(&*self.db) {
371 let source_root = self.db.file_source_root(file_id);
371 let diag = match problem { 372 let diag = match problem {
372 Problem::UnresolvedModule { candidate } => { 373 Problem::UnresolvedModule { candidate } => {
373 let create_file = FileSystemEdit::CreateFile { 374 let create_file = FileSystemEdit::CreateFile {
374 anchor: file_id, 375 source_root,
375 path: candidate.clone(), 376 path: candidate.clone(),
376 }; 377 };
377 let fix = SourceChange { 378 let fix = SourceChange {
@@ -388,11 +389,12 @@ impl AnalysisImpl {
388 } 389 }
389 Problem::NotDirOwner { move_to, candidate } => { 390 Problem::NotDirOwner { move_to, candidate } => {
390 let move_file = FileSystemEdit::MoveFile { 391 let move_file = FileSystemEdit::MoveFile {
391 file: file_id, 392 src: file_id,
392 path: move_to.clone(), 393 dst_source_root: source_root,
394 dst_path: move_to.clone(),
393 }; 395 };
394 let create_file = FileSystemEdit::CreateFile { 396 let create_file = FileSystemEdit::CreateFile {
395 anchor: file_id, 397 source_root,
396 path: move_to.join(candidate), 398 path: move_to.join(candidate),
397 }; 399 };
398 let fix = SourceChange { 400 let fix = SourceChange {
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs
index 2fb11365c..c7e7dc1c0 100644
--- a/crates/ra_analysis/src/lib.rs
+++ b/crates/ra_analysis/src/lib.rs
@@ -173,12 +173,13 @@ pub struct SourceFileEdit {
173#[derive(Debug)] 173#[derive(Debug)]
174pub enum FileSystemEdit { 174pub enum FileSystemEdit {
175 CreateFile { 175 CreateFile {
176 anchor: FileId, 176 source_root: SourceRootId,
177 path: RelativePathBuf, 177 path: RelativePathBuf,
178 }, 178 },
179 MoveFile { 179 MoveFile {
180 file: FileId, 180 src: FileId,
181 path: RelativePathBuf, 181 dst_source_root: SourceRootId,
182 dst_path: RelativePathBuf,
182 }, 183 },
183} 184}
184 185