Skip to content

Commit f3d9784

Browse files
committed
Hide default config in Debug impl
1 parent 582f1a6 commit f3d9784

File tree

1 file changed

+21
-1
lines changed
  • src/tools/rust-analyzer/crates/rust-analyzer/src

1 file changed

+21
-1
lines changed

src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ enum RatomlFile {
727727
Crate(LocalConfigInput),
728728
}
729729

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

768+
impl fmt::Debug for Config {
769+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
770+
f.debug_struct("Config")
771+
.field("discovered_projects_from_filesystem", &self.discovered_projects_from_filesystem)
772+
.field("discovered_projects_from_command", &self.discovered_projects_from_command)
773+
.field("workspace_roots", &self.workspace_roots)
774+
.field("caps", &self.caps)
775+
.field("root_path", &self.root_path)
776+
.field("snippets", &self.snippets)
777+
.field("visual_studio_code_version", &self.visual_studio_code_version)
778+
.field("client_config", &self.client_config)
779+
.field("user_config", &self.user_config)
780+
.field("ratoml_file", &self.ratoml_file)
781+
.field("source_root_parent_map", &self.source_root_parent_map)
782+
.field("validation_errors", &self.validation_errors)
783+
.field("detached_files", &self.detached_files)
784+
.finish()
785+
}
786+
}
787+
768788
// Delegate capability fetching methods
769789
impl std::ops::Deref for Config {
770790
type Target = ClientCapabilities;

0 commit comments

Comments
 (0)