diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-06 13:54:49 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-06 13:54:49 +0100 |
commit | 811492aa546d83daf56f61d334d6ee295651f111 (patch) | |
tree | 066a13499c26738cae11a34819b6048c5123d88b /crates/ra_lsp_server/src/main_loop.rs | |
parent | c9718691043b041f5db878caea687b5a029d4475 (diff) | |
parent | 3d45da9bca7ab772ea483b496a901fc500e22033 (diff) |
Merge #1657
1657: Ignore r=matklad a=matklad
closes #1616
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop.rs')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop.rs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 9a38d43d2..9d540a87e 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::{ | |||
23 | project_model::workspace_loader, | 23 | project_model::workspace_loader, |
24 | req, | 24 | req, |
25 | world::{Options, WorldSnapshot, WorldState}, | 25 | world::{Options, WorldSnapshot, WorldState}, |
26 | InitializationOptions, Result, | 26 | Result, ServerConfig, |
27 | }; | 27 | }; |
28 | 28 | ||
29 | const THREADPOOL_SIZE: usize = 8; | 29 | const THREADPOOL_SIZE: usize = 8; |
@@ -52,10 +52,11 @@ impl Error for LspError {} | |||
52 | pub fn main_loop( | 52 | pub fn main_loop( |
53 | ws_roots: Vec<PathBuf>, | 53 | ws_roots: Vec<PathBuf>, |
54 | client_caps: ClientCapabilities, | 54 | client_caps: ClientCapabilities, |
55 | options: InitializationOptions, | 55 | config: ServerConfig, |
56 | msg_receiver: &Receiver<RawMessage>, | 56 | msg_receiver: &Receiver<RawMessage>, |
57 | msg_sender: &Sender<RawMessage>, | 57 | msg_sender: &Sender<RawMessage>, |
58 | ) -> Result<()> { | 58 | ) -> Result<()> { |
59 | log::debug!("server_config: {:?}", config); | ||
59 | // FIXME: support dynamic workspace loading. | 60 | // FIXME: support dynamic workspace loading. |
60 | let workspaces = { | 61 | let workspaces = { |
61 | let ws_worker = workspace_loader(); | 62 | let ws_worker = workspace_loader(); |
@@ -77,14 +78,19 @@ pub fn main_loop( | |||
77 | } | 78 | } |
78 | loaded_workspaces | 79 | loaded_workspaces |
79 | }; | 80 | }; |
80 | 81 | let globs = config | |
82 | .exclude_globs | ||
83 | .iter() | ||
84 | .map(|glob| ra_vfs_glob::Glob::new(glob)) | ||
85 | .collect::<std::result::Result<Vec<_>, _>>()?; | ||
81 | let mut state = WorldState::new( | 86 | let mut state = WorldState::new( |
82 | ws_roots, | 87 | ws_roots, |
83 | workspaces, | 88 | workspaces, |
84 | options.lru_capacity, | 89 | config.lru_capacity, |
90 | &globs, | ||
85 | Options { | 91 | Options { |
86 | publish_decorations: options.publish_decorations, | 92 | publish_decorations: config.publish_decorations, |
87 | show_workspace_loaded: options.show_workspace_loaded, | 93 | show_workspace_loaded: config.show_workspace_loaded, |
88 | supports_location_link: client_caps | 94 | supports_location_link: client_caps |
89 | .text_document | 95 | .text_document |
90 | .and_then(|it| it.definition) | 96 | .and_then(|it| it.definition) |