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_db/src/fixture.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_db/src/fixture.rs')
-rw-r--r-- | crates/ra_db/src/fixture.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs index da7af110c..947d6ad56 100644 --- a/crates/ra_db/src/fixture.rs +++ b/crates/ra_db/src/fixture.rs | |||
@@ -56,6 +56,7 @@ fn with_single_file(db: &mut dyn SourceDatabaseExt, text: &str) -> FileId { | |||
56 | crate_graph.add_crate_root( | 56 | crate_graph.add_crate_root( |
57 | file_id, | 57 | file_id, |
58 | Edition::Edition2018, | 58 | Edition::Edition2018, |
59 | None, | ||
59 | CfgOptions::default(), | 60 | CfgOptions::default(), |
60 | Env::default(), | 61 | Env::default(), |
61 | ); | 62 | ); |
@@ -98,8 +99,13 @@ fn with_files(db: &mut dyn SourceDatabaseExt, fixture: &str) -> Option<FilePosit | |||
98 | assert!(meta.path.starts_with(&source_root_prefix)); | 99 | assert!(meta.path.starts_with(&source_root_prefix)); |
99 | 100 | ||
100 | if let Some(krate) = meta.krate { | 101 | if let Some(krate) = meta.krate { |
101 | let crate_id = | 102 | let crate_id = crate_graph.add_crate_root( |
102 | crate_graph.add_crate_root(file_id, meta.edition, meta.cfg, Env::default()); | 103 | file_id, |
104 | meta.edition, | ||
105 | Some(krate.clone()), | ||
106 | meta.cfg, | ||
107 | Env::default(), | ||
108 | ); | ||
103 | let prev = crates.insert(krate.clone(), crate_id); | 109 | let prev = crates.insert(krate.clone(), crate_id); |
104 | assert!(prev.is_none()); | 110 | assert!(prev.is_none()); |
105 | for dep in meta.deps { | 111 | for dep in meta.deps { |
@@ -132,6 +138,7 @@ fn with_files(db: &mut dyn SourceDatabaseExt, fixture: &str) -> Option<FilePosit | |||
132 | crate_graph.add_crate_root( | 138 | crate_graph.add_crate_root( |
133 | crate_root, | 139 | crate_root, |
134 | Edition::Edition2018, | 140 | Edition::Edition2018, |
141 | None, | ||
135 | CfgOptions::default(), | 142 | CfgOptions::default(), |
136 | Env::default(), | 143 | Env::default(), |
137 | ); | 144 | ); |