diff options
Diffstat (limited to 'crates/rust-analyzer/src/bin/main.rs')
-rw-r--r-- | crates/rust-analyzer/src/bin/main.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/crates/rust-analyzer/src/bin/main.rs b/crates/rust-analyzer/src/bin/main.rs index defdcbd74..3af3c59d8 100644 --- a/crates/rust-analyzer/src/bin/main.rs +++ b/crates/rust-analyzer/src/bin/main.rs | |||
@@ -8,11 +8,7 @@ use std::{convert::TryFrom, env, fs, path::PathBuf, process}; | |||
8 | 8 | ||
9 | use lsp_server::Connection; | 9 | use lsp_server::Connection; |
10 | use project_model::ProjectManifest; | 10 | use project_model::ProjectManifest; |
11 | use rust_analyzer::{ | 11 | use rust_analyzer::{cli, config::Config, from_json, Result}; |
12 | cli, | ||
13 | config::{Config, LinkedProject}, | ||
14 | from_json, Result, | ||
15 | }; | ||
16 | use vfs::AbsPathBuf; | 12 | use vfs::AbsPathBuf; |
17 | 13 | ||
18 | #[cfg(all(feature = "mimalloc"))] | 14 | #[cfg(all(feature = "mimalloc"))] |
@@ -138,13 +134,12 @@ fn run_server() -> Result<()> { | |||
138 | } | 134 | } |
139 | }; | 135 | }; |
140 | 136 | ||
141 | let mut config = Config::new(root_path); | 137 | let mut config = Config::new(root_path, initialize_params.capabilities); |
142 | if let Some(json) = initialize_params.initialization_options { | 138 | if let Some(json) = initialize_params.initialization_options { |
143 | config.update(json); | 139 | config.update(json); |
144 | } | 140 | } |
145 | config.update_caps(&initialize_params.capabilities); | ||
146 | 141 | ||
147 | if config.linked_projects.is_empty() { | 142 | if config.linked_projects().is_empty() { |
148 | let workspace_roots = initialize_params | 143 | let workspace_roots = initialize_params |
149 | .workspace_folders | 144 | .workspace_folders |
150 | .map(|workspaces| { | 145 | .map(|workspaces| { |
@@ -163,7 +158,7 @@ fn run_server() -> Result<()> { | |||
163 | log::error!("failed to find any projects in {:?}", workspace_roots); | 158 | log::error!("failed to find any projects in {:?}", workspace_roots); |
164 | } | 159 | } |
165 | 160 | ||
166 | config.linked_projects = discovered.into_iter().map(LinkedProject::from).collect(); | 161 | config.discovered_projects = Some(discovered); |
167 | } | 162 | } |
168 | 163 | ||
169 | config | 164 | config |