mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Minor
This commit is contained in:
parent
57ed622ec4
commit
6a694ad047
2 changed files with 9 additions and 22 deletions
|
@ -45,7 +45,7 @@ impl ops::Index<Target> for CargoWorkspace {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Default, Clone, Debug, PartialEq, Eq)]
|
||||
pub struct CargoConfig {
|
||||
/// Do not activate the `default` feature.
|
||||
pub no_default_features: bool,
|
||||
|
@ -64,18 +64,6 @@ pub struct CargoConfig {
|
|||
pub target: Option<String>,
|
||||
}
|
||||
|
||||
impl Default for CargoConfig {
|
||||
fn default() -> Self {
|
||||
CargoConfig {
|
||||
no_default_features: false,
|
||||
all_features: false,
|
||||
features: Vec::new(),
|
||||
load_out_dirs_from_check: false,
|
||||
target: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub type Package = Idx<PackageData>;
|
||||
|
||||
pub type Target = Idx<TargetData>;
|
||||
|
|
|
@ -27,16 +27,15 @@ impl GlobalState {
|
|||
}
|
||||
pub(crate) fn reload(&mut self) {
|
||||
log::info!("reloading projects: {:?}", self.config.linked_projects);
|
||||
let workspaces = {
|
||||
if self.config.linked_projects.is_empty()
|
||||
&& self.config.notifications.cargo_toml_not_found
|
||||
{
|
||||
self.show_message(
|
||||
lsp_types::MessageType::Error,
|
||||
"rust-analyzer failed to discover workspace".to_string(),
|
||||
);
|
||||
};
|
||||
if self.config.linked_projects.is_empty() && self.config.notifications.cargo_toml_not_found
|
||||
{
|
||||
self.show_message(
|
||||
lsp_types::MessageType::Error,
|
||||
"rust-analyzer failed to discover workspace".to_string(),
|
||||
);
|
||||
};
|
||||
|
||||
let workspaces = {
|
||||
self.config
|
||||
.linked_projects
|
||||
.iter()
|
||||
|
|
Loading…
Reference in a new issue