From f70b7e1f079e7b4a51ddd6503860eb97f1a6fcbe Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 6 Aug 2019 13:12:58 +0200 Subject: rename config --- crates/ra_lsp_server/src/main_loop.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_lsp_server/src/main_loop.rs') diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 9a38d43d2..8ab501828 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs @@ -23,7 +23,7 @@ use crate::{ project_model::workspace_loader, req, world::{Options, WorldSnapshot, WorldState}, - InitializationOptions, Result, + Result, ServerConfig, }; const THREADPOOL_SIZE: usize = 8; @@ -52,7 +52,7 @@ impl Error for LspError {} pub fn main_loop( ws_roots: Vec, client_caps: ClientCapabilities, - options: InitializationOptions, + config: ServerConfig, msg_receiver: &Receiver, msg_sender: &Sender, ) -> Result<()> { @@ -81,10 +81,10 @@ pub fn main_loop( let mut state = WorldState::new( ws_roots, workspaces, - options.lru_capacity, + config.lru_capacity, Options { - publish_decorations: options.publish_decorations, - show_workspace_loaded: options.show_workspace_loaded, + publish_decorations: config.publish_decorations, + show_workspace_loaded: config.show_workspace_loaded, supports_location_link: client_caps .text_document .and_then(|it| it.definition) -- cgit v1.2.3 From deea8f52d9803bb8a93d5dbd935970a20f07a51e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 6 Aug 2019 13:34:28 +0200 Subject: allow to exclude certain files and directories --- crates/ra_lsp_server/src/main_loop.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'crates/ra_lsp_server/src/main_loop.rs') diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 8ab501828..9d540a87e 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs @@ -56,6 +56,7 @@ pub fn main_loop( msg_receiver: &Receiver, msg_sender: &Sender, ) -> Result<()> { + log::debug!("server_config: {:?}", config); // FIXME: support dynamic workspace loading. let workspaces = { let ws_worker = workspace_loader(); @@ -77,11 +78,16 @@ pub fn main_loop( } loaded_workspaces }; - + let globs = config + .exclude_globs + .iter() + .map(|glob| ra_vfs_glob::Glob::new(glob)) + .collect::, _>>()?; let mut state = WorldState::new( ws_roots, workspaces, config.lru_capacity, + &globs, Options { publish_decorations: config.publish_decorations, show_workspace_loaded: config.show_workspace_loaded, -- cgit v1.2.3