Skip to content

Commit 27ed376

Browse files
committed
add support of feature flag for runnables #4464
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
1 parent 48d7c61 commit 27ed376

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

crates/ra_ide/src/runnables.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use itertools::Itertools;
55
use ra_ide_db::RootDatabase;
66
use ra_syntax::{
77
ast::{self, AstNode, AttrsOwner, ModuleItemOwner, NameOwner},
8-
match_ast, SmolStr, SyntaxNode, TextRange,
8+
match_ast, SyntaxNode, TextRange,
99
};
1010

1111
use crate::FileId;

crates/rust-analyzer/src/main_loop/handlers.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ use crate::{
3939
world::WorldSnapshot,
4040
LspError, Result,
4141
};
42-
use hir::Attrs;
4342

4443
pub fn handle_analyzer_status(world: WorldSnapshot, _: ()) -> Result<String> {
4544
let _p = profile("handle_analyzer_status");
@@ -1039,19 +1038,6 @@ fn to_lsp_runnable(
10391038
})
10401039
}
10411040

1042-
fn get_features_needed(attrs: Attrs) -> Option<Vec<SmolStr>> {
1043-
let cfg_expr = attrs.by_key("cfg").tt_values().map(|subtree| ra_cfg::parse_cfg(subtree));
1044-
let features_needed = cfg_expr
1045-
.map(|cfg| {
1046-
let mut min_features = vec![];
1047-
collect_minimal_features_needed(&cfg, &mut min_features);
1048-
min_features
1049-
})
1050-
.flatten()
1051-
.collect();
1052-
Some(features_needed).filter(|it: &Vec<SmolStr>| !it.is_empty())
1053-
}
1054-
10551041
/// Fill minimal features needed
10561042
fn collect_minimal_features_needed(cfg_expr: &CfgExpr, features: &mut Vec<SmolStr>) {
10571043
match cfg_expr {

0 commit comments

Comments
 (0)