aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_project_model/src/lib.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs
index a8594a697..cfebf36f8 100644
--- a/crates/ra_project_model/src/lib.rs
+++ b/crates/ra_project_model/src/lib.rs
@@ -421,19 +421,14 @@ fn find_cargo_toml_down_the_fs(path: &Path) -> Option<PathBuf> {
421} 421}
422 422
423fn find_cargo_toml_up_the_fs(path: &Path) -> Option<PathBuf> { 423fn find_cargo_toml_up_the_fs(path: &Path) -> Option<PathBuf> {
424 log::info!("find_cargo_toml_up_the_fs()");
425 let entities = match read_dir(path) { 424 let entities = match read_dir(path) {
426 Ok(entities) => entities, 425 Ok(entities) => entities,
427 Err(e) => { 426 Err(_) => return None
428 log::info!("err {}", e);
429 return None
430 }
431 }; 427 };
432 428
433 log::info!("entities: {:?}", entities); 429 // Only one level up to avoid cycles the easy way and stop a runaway scan with large projects
434 for entity in entities.filter_map(Result::ok) { 430 for entity in entities.filter_map(Result::ok) {
435 let candidate = entity.path().join("Cargo.toml"); 431 let candidate = entity.path().join("Cargo.toml");
436 log::info!("candidate: {:?}, exists: {}", candidate, candidate.exists());
437 if candidate.exists() { 432 if candidate.exists() {
438 return Some(candidate); 433 return Some(candidate);
439 } 434 }