diff options
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/runnables.rs | 7 |
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 | } |