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.

settings: Remove the `project_name` project setting (#54511)

Tom Houlédfb8e3451cfd
diff --git a/assets/settings/default.json b/assets/settings/default.json
index d0cd8d2276f..2b899283841 100644
--- a/assets/settings/default.json
+++ b/assets/settings/default.json
@@ -1,8 +1,5 @@
{
"$schema": "zed://schemas/settings",
- /// The displayed name of this project. If not set or null, the root directory name
- /// will be displayed.
- "project_name": null,
// The name of the Zed theme to use for the UI.
//
// `mode` is one of:
diff --git a/crates/settings/src/vscode_import.rs b/crates/settings/src/vscode_import.rs
index d2e4681db75..2fdd8e64580 100644
--- a/crates/settings/src/vscode_import.rs
+++ b/crates/settings/src/vscode_import.rs
@@ -1036,7 +1036,6 @@ impl VsCodeSettings {
fn worktree_settings_content(&self) -> WorktreeSettingsContent {
WorktreeSettingsContent {
- project_name: None,
prevent_sharing_in_public_channels: false,
file_scan_exclusions: self
.read_value("files.watcherExclude")
diff --git a/crates/settings_content/src/project.rs b/crates/settings_content/src/project.rs
index 6e8b296ef21..2a33373a853 100644
--- a/crates/settings_content/src/project.rs
+++ b/crates/settings_content/src/project.rs
@@ -90,12 +90,6 @@ pub struct ProjectSettingsContent {
#[with_fallible_options]
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, JsonSchema, MergeFrom)]
pub struct WorktreeSettingsContent {
- /// The displayed name of this project. If not set or null, the root directory name
- /// will be displayed.
- ///
- /// Default: null
- pub project_name: Option<String>,
-
/// Whether to prevent this project from being shared in public channels.
///
/// Default: false
diff --git a/crates/settings_ui/src/page_data.rs b/crates/settings_ui/src/page_data.rs
index 30d60febe5a..52557256f14 100644
--- a/crates/settings_ui/src/page_data.rs
+++ b/crates/settings_ui/src/page_data.rs
@@ -108,30 +108,6 @@ fn general_page(cx: &App) -> SettingsPage {
fn general_settings_section(_cx: &App) -> Vec<SettingsPageItem> {
vec![
SettingsPageItem::SectionHeader("General Settings"),
- SettingsPageItem::SettingItem(SettingItem {
- files: PROJECT,
- title: "Project Name",
- description: "The displayed name of this project. If left empty, the root directory name will be displayed.",
- field: Box::new(SettingField {
- json_path: Some("project_name"),
- pick: |settings_content| {
- settings_content
- .project
- .worktree
- .project_name
- .as_ref()
- .or(DEFAULT_EMPTY_STRING)
- },
- write: |settings_content, value| {
- settings_content.project.worktree.project_name =
- value.filter(|name| !name.is_empty());
- },
- }),
- metadata: Some(Box::new(SettingsFieldMetadata {
- placeholder: Some("Project Name"),
- ..Default::default()
- })),
- }),
SettingsPageItem::SettingItem(SettingItem {
title: "When Closing With No Tabs",
description: "What to do when using the 'close active item' action with no tabs.",
diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs
index e6312e69547..995023cdd29 100644
--- a/crates/workspace/src/workspace.rs
+++ b/crates/workspace/src/workspace.rs
@@ -5812,18 +5812,8 @@ impl Workspace {
let mut title = String::new();
for (i, worktree) in project.visible_worktrees(cx).enumerate() {
- let name = {
- let settings_location = SettingsLocation {
- worktree_id: worktree.read(cx).id(),
- path: RelPath::empty(),
- };
+ let name = worktree.read(cx).root_name_str();
- let settings = WorktreeSettings::get(Some(settings_location), cx);
- match &settings.project_name {
- Some(name) => name.as_str(),
- None => worktree.read(cx).root_name_str(),
- }
- };
if i > 0 {
title.push_str(", ");
}
diff --git a/crates/worktree/src/worktree_settings.rs b/crates/worktree/src/worktree_settings.rs
index 79b48248294..90fe5ba724b 100644
--- a/crates/worktree/src/worktree_settings.rs
+++ b/crates/worktree/src/worktree_settings.rs
@@ -10,7 +10,6 @@ use util::{
#[derive(Clone, PartialEq, Eq, RegisterSetting)]
pub struct WorktreeSettings {
- pub project_name: Option<String>,
/// Whether to prevent this project from being shared in public channels.
pub prevent_sharing_in_public_channels: bool,
pub file_scan_exclusions: PathMatcher,
@@ -76,7 +75,6 @@ impl Settings for WorktreeSettings {
.collect();
Self {
- project_name: worktree.project_name,
prevent_sharing_in_public_channels: worktree.prevent_sharing_in_public_channels,
file_scan_exclusions: path_matchers(file_scan_exclusions, "file_scan_exclusions")
.log_err()
diff --git a/crates/worktree/tests/integration/worktree_settings.rs b/crates/worktree/tests/integration/worktree_settings.rs
index 213d888e9f9..0a47766f35f 100644
--- a/crates/worktree/tests/integration/worktree_settings.rs
+++ b/crates/worktree/tests/integration/worktree_settings.rs
@@ -7,7 +7,6 @@ use worktree::*;
fn make_settings_with_read_only(patterns: &[&str]) -> WorktreeSettings {
WorktreeSettings {
- project_name: None,
prevent_sharing_in_public_channels: false,
file_scan_exclusions: PathMatcher::default(),
file_scan_inclusions: PathMatcher::default(),