diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-09 09:33:46 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-09 09:33:46 +0000 |
commit | 57c27f91392fdd9d72fd023f4e2fecd8b68a7d09 (patch) | |
tree | 23e1e0216789b8b21183e07b10f97e2f57ae033c /crates/ra_ide/src/mock_analysis.rs | |
parent | 58ab084034b760367359334807c7f7773faf7f92 (diff) | |
parent | e1aa96f2c5b6cdbf0fb7f49b47209055b7a937f2 (diff) |
Merge #3519
3519: Show mod path on hover r=matklad a=SomeoneToIgnore
Closes #1064
Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/mock_analysis.rs')
-rw-r--r-- | crates/ra_ide/src/mock_analysis.rs | 10 |
1 files changed, 8 insertions, 2 deletions
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 { | |||
99 | root_crate = Some(crate_graph.add_crate_root( | 99 | root_crate = Some(crate_graph.add_crate_root( |
100 | file_id, | 100 | file_id, |
101 | Edition2018, | 101 | Edition2018, |
102 | None, | ||
102 | cfg_options, | 103 | cfg_options, |
103 | Env::default(), | 104 | Env::default(), |
104 | )); | 105 | )); |
105 | } else if path.ends_with("/lib.rs") { | 106 | } else if path.ends_with("/lib.rs") { |
106 | let other_crate = | ||
107 | crate_graph.add_crate_root(file_id, Edition2018, cfg_options, Env::default()); | ||
108 | let crate_name = path.parent().unwrap().file_name().unwrap(); | 107 | let crate_name = path.parent().unwrap().file_name().unwrap(); |
108 | let other_crate = crate_graph.add_crate_root( | ||
109 | file_id, | ||
110 | Edition2018, | ||
111 | Some(crate_name.to_owned()), | ||
112 | cfg_options, | ||
113 | Env::default(), | ||
114 | ); | ||
109 | if let Some(root_crate) = root_crate { | 115 | if let Some(root_crate) = root_crate { |
110 | crate_graph | 116 | crate_graph |
111 | .add_dep(root_crate, CrateName::new(crate_name).unwrap(), other_crate) | 117 | .add_dep(root_crate, CrateName::new(crate_name).unwrap(), other_crate) |