Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add remote hostname to title bar project picker tooltip (#51616)

Casey Watsone67cf996ba46
diff --git a/crates/recent_projects/src/recent_projects.rs b/crates/recent_projects/src/recent_projects.rs
index c9720af2aba..7ecc6a399d6 100644
--- a/crates/recent_projects/src/recent_projects.rs
+++ b/crates/recent_projects/src/recent_projects.rs
@@ -1115,12 +1115,21 @@ impl PickerDelegate for RecentProjectsDelegate {
let (_, location, paths, _) = self.workspaces.get(hit.candidate_id)?;
let is_local = matches!(location, SerializedWorkspaceLocation::Local);
let paths_to_add = paths.paths().to_vec();
- let tooltip_path: SharedString = paths
+ let ordered_paths: Vec<_> = paths
.ordered_paths()
.map(|p| p.compact().to_string_lossy().to_string())
- .collect::<Vec<_>>()
- .join("\n")
- .into();
+ .collect();
+ let tooltip_path: SharedString = match &location {
+ SerializedWorkspaceLocation::Remote(options) => {
+ let host = options.display_name();
+ if ordered_paths.len() == 1 {
+ format!("{} ({})", ordered_paths[0], host).into()
+ } else {
+ format!("{}\n({})", ordered_paths.join("\n"), host).into()
+ }
+ }
+ _ => ordered_paths.join("\n").into(),
+ };
let mut path_start_offset = 0;
let (match_labels, paths): (Vec<_>, Vec<_>) = paths