From 69bbe79c5037eb3cd00744593d1836e45a6f56e1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 22 Aug 2019 14:44:16 +0300 Subject: implement feature flags --- crates/ra_lsp_server/src/config.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'crates/ra_lsp_server/src/config.rs') diff --git a/crates/ra_lsp_server/src/config.rs b/crates/ra_lsp_server/src/config.rs index 71838b89c..5c5ae3e18 100644 --- a/crates/ra_lsp_server/src/config.rs +++ b/crates/ra_lsp_server/src/config.rs @@ -1,3 +1,5 @@ +use rustc_hash::FxHashMap; + use serde::{Deserialize, Deserializer}; /// Client provided initialization options @@ -12,12 +14,6 @@ pub struct ServerConfig { #[serde(deserialize_with = "nullable_bool_false")] pub publish_decorations: bool, - /// Whether or not the workspace loaded notification should be sent - /// - /// Defaults to `true` - #[serde(deserialize_with = "nullable_bool_true")] - pub show_workspace_loaded: bool, - pub exclude_globs: Vec, pub lru_capacity: Option, @@ -25,16 +21,19 @@ pub struct ServerConfig { /// For internal usage to make integrated tests faster. #[serde(deserialize_with = "nullable_bool_true")] pub with_sysroot: bool, + + /// Fine grained feature flags to disable specific features. + pub feature_flags: FxHashMap, } impl Default for ServerConfig { fn default() -> ServerConfig { ServerConfig { publish_decorations: false, - show_workspace_loaded: true, exclude_globs: Vec::new(), lru_capacity: None, with_sysroot: true, + feature_flags: FxHashMap::default(), } } } -- cgit v1.2.3