mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Fix cfg completions not working
This commit is contained in:
parent
ca6ddd8ea3
commit
853f8a21f7
4 changed files with 98 additions and 33 deletions
|
@ -179,8 +179,8 @@ impl ChangeFixture {
|
|||
meta.edition,
|
||||
Some(crate_name.clone().into()),
|
||||
version,
|
||||
meta.cfg,
|
||||
Default::default(),
|
||||
meta.cfg.clone(),
|
||||
Some(meta.cfg),
|
||||
meta.env,
|
||||
false,
|
||||
origin,
|
||||
|
@ -200,7 +200,7 @@ impl ChangeFixture {
|
|||
} else if meta.path == "/main.rs" || meta.path == "/lib.rs" {
|
||||
assert!(default_crate_root.is_none());
|
||||
default_crate_root = Some(file_id);
|
||||
default_cfg = meta.cfg;
|
||||
default_cfg.extend(meta.cfg.into_iter());
|
||||
default_env.extend(meta.env.iter().map(|(x, y)| (x.to_owned(), y.to_owned())));
|
||||
default_target_data_layout = meta.target_data_layout;
|
||||
}
|
||||
|
@ -220,8 +220,8 @@ impl ChangeFixture {
|
|||
Edition::CURRENT,
|
||||
Some(CrateName::new("test").unwrap().into()),
|
||||
None,
|
||||
default_cfg,
|
||||
Default::default(),
|
||||
default_cfg.clone(),
|
||||
Some(default_cfg),
|
||||
default_env,
|
||||
false,
|
||||
CrateOrigin::Local { repo: None, name: None },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue