From 27ed376bc4dfed39295af650effe63007e443b6f Mon Sep 17 00:00:00 2001 From: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> Date: Sun, 24 May 2020 13:34:34 +0200 Subject: add support of feature flag for runnables #4464 Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> --- crates/ra_ide/src/runnables.rs | 2 +- crates/rust-analyzer/src/main_loop/handlers.rs | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) (limited to 'crates') diff --git a/crates/ra_ide/src/runnables.rs b/crates/ra_ide/src/runnables.rs index a96c5f157..ed98e58e0 100644 --- a/crates/ra_ide/src/runnables.rs +++ b/crates/ra_ide/src/runnables.rs @@ -5,7 +5,7 @@ use itertools::Itertools; use ra_ide_db::RootDatabase; use ra_syntax::{ ast::{self, AstNode, AttrsOwner, ModuleItemOwner, NameOwner}, - match_ast, SmolStr, SyntaxNode, TextRange, + match_ast, SyntaxNode, TextRange, }; use crate::FileId; diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs index 5f6e845a8..c51e4346a 100644 --- a/crates/rust-analyzer/src/main_loop/handlers.rs +++ b/crates/rust-analyzer/src/main_loop/handlers.rs @@ -39,7 +39,6 @@ use crate::{ world::WorldSnapshot, LspError, Result, }; -use hir::Attrs; pub fn handle_analyzer_status(world: WorldSnapshot, _: ()) -> Result { let _p = profile("handle_analyzer_status"); @@ -1039,19 +1038,6 @@ fn to_lsp_runnable( }) } -fn get_features_needed(attrs: Attrs) -> Option> { - let cfg_expr = attrs.by_key("cfg").tt_values().map(|subtree| ra_cfg::parse_cfg(subtree)); - let features_needed = cfg_expr - .map(|cfg| { - let mut min_features = vec![]; - collect_minimal_features_needed(&cfg, &mut min_features); - min_features - }) - .flatten() - .collect(); - Some(features_needed).filter(|it: &Vec| !it.is_empty()) -} - /// Fill minimal features needed fn collect_minimal_features_needed(cfg_expr: &CfgExpr, features: &mut Vec) { match cfg_expr { -- cgit v1.2.3