From 284483b347d15bee3a7bf293d33e5f19a9740102 Mon Sep 17 00:00:00 2001 From: Jamie Cunliffe Date: Sun, 30 May 2021 14:52:19 +0100 Subject: 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. --- crates/ide/src/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'crates/ide') diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index 3798f32cc..0693869a2 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs @@ -220,6 +220,7 @@ impl Analysis { cfg_options, Env::default(), Default::default(), + Default::default(), ); change.change_file(file_id, Some(Arc::new(text))); change.set_crate_graph(crate_graph); -- cgit v1.2.3 From ae823aa23f1c4fa55e71dd972d0b10c69148b0b4 Mon Sep 17 00:00:00 2001 From: Jamie Cunliffe Date: Mon, 31 May 2021 20:45:01 +0100 Subject: Move features into potential_cfg_options --- crates/ide/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ide') diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index 0693869a2..aac084012 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs @@ -217,10 +217,10 @@ impl Analysis { file_id, Edition::Edition2018, None, + cfg_options.clone(), cfg_options, Env::default(), Default::default(), - Default::default(), ); change.change_file(file_id, Some(Arc::new(text))); change.set_crate_graph(crate_graph); -- cgit v1.2.3