From 83f0a3fd1364bcb39fe4a69dd5a417aa6c54f89a Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Tue, 25 Nov 2025 14:00:31 -0500 Subject: [PATCH] Redact sensitive environment variables in LSP Logs: Server Info (#43480) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to: - https://github.com/zed-industries/zed/pull/43436 - https://github.com/zed-industries/zed/pull/42831 The changes in #42831 resulted in a regression where environment variables in the Server Info view were no longer redact. The changes in #43436 were insufficient as I was still seeing sensitive values in Nightly e6fe95b4f2f676c7fc4a5f951ba7c721e7d22e8a (which includes #43436). CC: @SomeoneToIgnore (Hi! 👋 Thanks for keeping this redaction functionality alive) Release Notes: - N/A --- crates/language_tools/src/lsp_log_view.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/language_tools/src/lsp_log_view.rs b/crates/language_tools/src/lsp_log_view.rs index e7586583704750b0c84832ecb8cb9ba8d5a9b5a1..4cf47cab079617d55aeeb959dcad116919a55609 100644 --- a/crates/language_tools/src/lsp_log_view.rs +++ b/crates/language_tools/src/lsp_log_view.rs @@ -340,11 +340,11 @@ impl LspLogView { * Configuration: {CONFIGURATION}", NAME = info.status.name, ID = info.id, - BINARY = info.status.binary.as_ref().map_or_else( - || "Unknown".to_string(), - |binary| serde_json::to_string_pretty(binary) - .unwrap_or_else(|e| format!("Failed to serialize binary info: {e:#}")) - ), + BINARY = info + .status + .binary + .as_ref() + .map_or_else(|| "Unknown".to_string(), |binary| format!("{:#?}", binary)), WORKSPACE_FOLDERS = info .status .workspace_folders