Skip to content

Commit

Permalink
Merge pull request #18396 from lnicola/hide-default-config
Browse files Browse the repository at this point in the history
internal: Hide `Config::default_config`
  • Loading branch information
lnicola authored Oct 24, 2024
2 parents 6342667 + 0d3d891 commit 16785c8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ smallvec = { version = "1.10.0", features = [
"union",
"const_generics",
] }
smol_str = "0.3.1"
smol_str = "0.3.2"
snap = "1.1.0"
text-size = "1.1.1"
tracing = "0.1.40"
Expand Down
22 changes: 21 additions & 1 deletion crates/rust-analyzer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ enum RatomlFile {
Crate(LocalConfigInput),
}

#[derive(Debug, Clone)]
#[derive(Clone)]
pub struct Config {
/// Projects that have a Cargo.toml or a rust-project.json in a
/// parent directory, so we can discover them by walking the
Expand Down Expand Up @@ -765,6 +765,26 @@ pub struct Config {
detached_files: Vec<AbsPathBuf>,
}

impl fmt::Debug for Config {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Config")
.field("discovered_projects_from_filesystem", &self.discovered_projects_from_filesystem)
.field("discovered_projects_from_command", &self.discovered_projects_from_command)
.field("workspace_roots", &self.workspace_roots)
.field("caps", &self.caps)
.field("root_path", &self.root_path)
.field("snippets", &self.snippets)
.field("visual_studio_code_version", &self.visual_studio_code_version)
.field("client_config", &self.client_config)
.field("user_config", &self.user_config)
.field("ratoml_file", &self.ratoml_file)
.field("source_root_parent_map", &self.source_root_parent_map)
.field("validation_errors", &self.validation_errors)
.field("detached_files", &self.detached_files)
.finish()
}
}

// Delegate capability fetching methods
impl std::ops::Deref for Config {
type Target = ClientCapabilities;
Expand Down

0 comments on commit 16785c8

Please sign in to comment.