From 5cffef56e2c373f6d67b0f7b70d7ade995795c04 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sun, 8 Mar 2020 15:26:57 +0200 Subject: Consider crate declaration names --- crates/ra_ide/src/mock_analysis.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide/src/mock_analysis.rs') diff --git a/crates/ra_ide/src/mock_analysis.rs b/crates/ra_ide/src/mock_analysis.rs index f4cd6deb7..90f84b052 100644 --- a/crates/ra_ide/src/mock_analysis.rs +++ b/crates/ra_ide/src/mock_analysis.rs @@ -99,13 +99,19 @@ impl MockAnalysis { root_crate = Some(crate_graph.add_crate_root( file_id, Edition2018, + None, cfg_options, Env::default(), )); } else if path.ends_with("/lib.rs") { - let other_crate = - crate_graph.add_crate_root(file_id, Edition2018, cfg_options, Env::default()); let crate_name = path.parent().unwrap().file_name().unwrap(); + let other_crate = crate_graph.add_crate_root( + file_id, + Edition2018, + Some(crate_name.to_owned()), + cfg_options, + Env::default(), + ); if let Some(root_crate) = root_crate { crate_graph .add_dep(root_crate, CrateName::new(crate_name).unwrap(), other_crate) -- cgit v1.2.3