diff options
-rw-r--r-- | crates/ra_project_model/src/cargo_workspace.rs | 14 | ||||
-rw-r--r-- | crates/rust-analyzer/src/reload.rs | 17 |
2 files changed, 9 insertions, 22 deletions
diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/ra_project_model/src/cargo_workspace.rs index 47a1d393d..361fc8eea 100644 --- a/crates/ra_project_model/src/cargo_workspace.rs +++ b/crates/ra_project_model/src/cargo_workspace.rs | |||
@@ -45,7 +45,7 @@ impl ops::Index<Target> for CargoWorkspace { | |||
45 | } | 45 | } |
46 | } | 46 | } |
47 | 47 | ||
48 | #[derive(Clone, Debug, PartialEq, Eq)] | 48 | #[derive(Default, Clone, Debug, PartialEq, Eq)] |
49 | pub struct CargoConfig { | 49 | pub struct CargoConfig { |
50 | /// Do not activate the `default` feature. | 50 | /// Do not activate the `default` feature. |
51 | pub no_default_features: bool, | 51 | pub no_default_features: bool, |
@@ -64,18 +64,6 @@ pub struct CargoConfig { | |||
64 | pub target: Option<String>, | 64 | pub target: Option<String>, |
65 | } | 65 | } |
66 | 66 | ||
67 | impl Default for CargoConfig { | ||
68 | fn default() -> Self { | ||
69 | CargoConfig { | ||
70 | no_default_features: false, | ||
71 | all_features: false, | ||
72 | features: Vec::new(), | ||
73 | load_out_dirs_from_check: false, | ||
74 | target: None, | ||
75 | } | ||
76 | } | ||
77 | } | ||
78 | |||
79 | pub type Package = Idx<PackageData>; | 67 | pub type Package = Idx<PackageData>; |
80 | 68 | ||
81 | pub type Target = Idx<TargetData>; | 69 | pub type Target = Idx<TargetData>; |
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index 523b04b97..9fc56349c 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs | |||
@@ -27,16 +27,15 @@ impl GlobalState { | |||
27 | } | 27 | } |
28 | pub(crate) fn reload(&mut self) { | 28 | pub(crate) fn reload(&mut self) { |
29 | log::info!("reloading projects: {:?}", self.config.linked_projects); | 29 | log::info!("reloading projects: {:?}", self.config.linked_projects); |
30 | let workspaces = { | 30 | if self.config.linked_projects.is_empty() && self.config.notifications.cargo_toml_not_found |
31 | if self.config.linked_projects.is_empty() | 31 | { |
32 | && self.config.notifications.cargo_toml_not_found | 32 | self.show_message( |
33 | { | 33 | lsp_types::MessageType::Error, |
34 | self.show_message( | 34 | "rust-analyzer failed to discover workspace".to_string(), |
35 | lsp_types::MessageType::Error, | 35 | ); |
36 | "rust-analyzer failed to discover workspace".to_string(), | 36 | }; |
37 | ); | ||
38 | }; | ||
39 | 37 | ||
38 | let workspaces = { | ||
40 | self.config | 39 | self.config |
41 | .linked_projects | 40 | .linked_projects |
42 | .iter() | 41 | .iter() |