aboutsummaryrefslogtreecommitdiff
path: root/crates/base_db/src/fixture.rs
diff options
context:
space:
mode:
authorJamie Cunliffe <[email protected]>2021-05-30 14:52:19 +0100
committerJamie Cunliffe <[email protected]>2021-06-21 17:47:00 +0100
commit284483b347d15bee3a7bf293d33e5f19a9740102 (patch)
treee582a7ecdef30511b8982529f11889f1aab3ca5e /crates/base_db/src/fixture.rs
parent1b05dbba39d5a4d46f321dc962df99038cddbf21 (diff)
Improve completion of cfg attributes
The completion of cfg will look at the enabled cfg keys when performing completion. It will also look crate features when completing a feature cfg option. A fixed list of known values for some cfg options are provided. For unknown keys it will look at the enabled values for that cfg key, which means that completion will only show enabled options for those.
Diffstat (limited to 'crates/base_db/src/fixture.rs')
-rw-r--r--crates/base_db/src/fixture.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/base_db/src/fixture.rs b/crates/base_db/src/fixture.rs
index 6ce377710..6d3b1266e 100644
--- a/crates/base_db/src/fixture.rs
+++ b/crates/base_db/src/fixture.rs
@@ -131,6 +131,7 @@ impl ChangeFixture {
131 meta.cfg, 131 meta.cfg,
132 meta.env, 132 meta.env,
133 Default::default(), 133 Default::default(),
134 Default::default(),
134 ); 135 );
135 let prev = crates.insert(crate_name.clone(), crate_id); 136 let prev = crates.insert(crate_name.clone(), crate_id);
136 assert!(prev.is_none()); 137 assert!(prev.is_none());
@@ -160,6 +161,7 @@ impl ChangeFixture {
160 default_cfg, 161 default_cfg,
161 Env::default(), 162 Env::default(),
162 Default::default(), 163 Default::default(),
164 Default::default(),
163 ); 165 );
164 } else { 166 } else {
165 for (from, to) in crate_deps { 167 for (from, to) in crate_deps {