Redact environment variables in server info view (#43436)

Follow-up of https://github.com/zed-industries/zed/pull/42831

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov
2025-11-24 22:05:16 +00:00
committed by GitHub
parent 8fd2e2164c
commit 17d7988ad4
4 changed files with 22 additions and 48 deletions
+2 -18
View File
@@ -3729,13 +3729,6 @@ pub enum LspStoreEvent {
},
}
#[derive(Clone, Debug, Serialize)]
pub struct LanguageServerBinaryInfo {
pub path: String,
pub arguments: Vec<String>,
pub env: Option<HashMap<String, String>>,
}
#[derive(Clone, Debug, Serialize)]
pub struct LanguageServerStatus {
pub name: LanguageServerName,
@@ -3743,7 +3736,7 @@ pub struct LanguageServerStatus {
pub has_pending_diagnostic_updates: bool,
pub progress_tokens: HashSet<ProgressToken>,
pub worktree: Option<WorktreeId>,
pub binary: Option<LanguageServerBinaryInfo>,
pub binary: Option<LanguageServerBinary>,
pub configuration: Option<Value>,
pub workspace_folders: BTreeSet<Uri>,
}
@@ -11187,16 +11180,7 @@ impl LspStore {
has_pending_diagnostic_updates: false,
progress_tokens: Default::default(),
worktree: Some(key.worktree_id),
binary: Some(LanguageServerBinaryInfo {
path: language_server.binary().path.to_string_lossy().into_owned(),
arguments: language_server
.binary()
.arguments
.iter()
.map(|arg| arg.to_string_lossy().into_owned())
.collect(),
env: language_server.binary().env.clone(),
}),
binary: Some(language_server.binary().clone()),
configuration: Some(language_server.configuration().clone()),
workspace_folders: language_server.workspace_folders(),
},
+13 -8
View File
@@ -37,7 +37,7 @@ use dap::inline_value::{InlineValueLocation, VariableLookupKind, VariableScope};
use crate::{
git_store::GitStore,
lsp_store::{LanguageServerBinaryInfo, SymbolLocation, log_store::LogKind},
lsp_store::{SymbolLocation, log_store::LogKind},
project_search::SearchResultsHandle,
};
pub use agent_server_store::{AgentServerStore, AgentServersUpdated, ExternalAgentServerName};
@@ -87,7 +87,8 @@ use language::{
};
use lsp::{
CodeActionKind, CompletionContext, CompletionItemKind, DocumentHighlightKind, InsertTextMode,
LanguageServerId, LanguageServerName, LanguageServerSelector, MessageActionItem,
LanguageServerBinary, LanguageServerId, LanguageServerName, LanguageServerSelector,
MessageActionItem,
};
use lsp_command::*;
use lsp_store::{CompletionDocumentation, LspFormatTarget, OpenLspBufferHandle};
@@ -111,6 +112,7 @@ use snippet_provider::SnippetProvider;
use std::{
borrow::Cow,
collections::BTreeMap,
ffi::OsString,
ops::{Not as _, Range},
path::{Path, PathBuf},
pin::pin,
@@ -3125,12 +3127,15 @@ impl Project {
.get_mut(language_server_id)
{
if let Some(binary) = &update.binary {
language_server_status.binary =
Some(LanguageServerBinaryInfo {
path: binary.path.clone(),
arguments: binary.arguments.clone(),
env: None,
});
language_server_status.binary = Some(LanguageServerBinary {
path: PathBuf::from(&binary.path),
arguments: binary
.arguments
.iter()
.map(OsString::from)
.collect(),
env: None,
});
}
language_server_status.configuration = update