aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-23 15:55:22 +0100
committerGitHub <[email protected]>2020-07-23 15:55:22 +0100
commit8df105b8b2061f33ed437a93ff72037a625f1a75 (patch)
treed7966981b7682eac07a24d57eb24b847323d0d25 /crates/ra_ide
parent7bada8a76dd6438cb6549d735d06e60fc50f6388 (diff)
parent38e38d9b290ff90973c25a06962b81dbbb5d3d9e (diff)
Merge #5505
5505: Cleanup CFG API r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/runnables.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/ra_ide/src/runnables.rs b/crates/ra_ide/src/runnables.rs
index 0994beec5..95a35a28d 100644
--- a/crates/ra_ide/src/runnables.rs
+++ b/crates/ra_ide/src/runnables.rs
@@ -168,8 +168,7 @@ fn runnable_fn(
168 }; 168 };
169 169
170 let attrs = Attrs::from_attrs_owner(sema.db, InFile::new(HirFileId::from(file_id), &fn_def)); 170 let attrs = Attrs::from_attrs_owner(sema.db, InFile::new(HirFileId::from(file_id), &fn_def));
171 let cfg_exprs = 171 let cfg_exprs = attrs.cfg().collect();
172 attrs.by_key("cfg").tt_values().map(|subtree| ra_cfg::parse_cfg(subtree)).collect();
173 172
174 let nav = if let RunnableKind::DocTest { .. } = kind { 173 let nav = if let RunnableKind::DocTest { .. } = kind {
175 NavigationTarget::from_doc_commented( 174 NavigationTarget::from_doc_commented(
@@ -242,9 +241,7 @@ fn runnable_mod(
242 .join("::"); 241 .join("::");
243 242
244 let attrs = Attrs::from_attrs_owner(sema.db, InFile::new(HirFileId::from(file_id), &module)); 243 let attrs = Attrs::from_attrs_owner(sema.db, InFile::new(HirFileId::from(file_id), &module));
245 let cfg_exprs = 244 let cfg_exprs = attrs.cfg().collect();
246 attrs.by_key("cfg").tt_values().map(|subtree| ra_cfg::parse_cfg(subtree)).collect();
247
248 let nav = module_def.to_nav(sema.db); 245 let nav = module_def.to_nav(sema.db);
249 Some(Runnable { nav, kind: RunnableKind::TestMod { path }, cfg_exprs }) 246 Some(Runnable { nav, kind: RunnableKind::TestMod { path }, cfg_exprs })
250} 247}