-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for folder-specific settings (#2537)
This PR allows you to customize Zed's settings within a particular folder by creating a `.zed/settings.json` file within that folder. Todo * [x] respect folder-specific settings for local projects * [x] respect folder-specific settings in remote projects * [x] pass a path when retrieving editor/language settings * [x] pass a path when retrieving copilot settings * [ ] update the `Setting` trait to make it clear which types of settings are locally overridable Release Notes: * Added support for folder-specific settings. You can customize Zed's settings within a particular folder by creating a `.zed` directory and a `.zed/settings.json` file within that folder.
- Loading branch information
Showing
27 changed files
with
797 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
crates/collab/migrations/20230529164700_add_worktree_settings_files.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
CREATE TABLE "worktree_settings_files" ( | ||
"project_id" INTEGER NOT NULL, | ||
"worktree_id" INT8 NOT NULL, | ||
"path" VARCHAR NOT NULL, | ||
"content" TEXT NOT NULL, | ||
PRIMARY KEY(project_id, worktree_id, path), | ||
FOREIGN KEY(project_id, worktree_id) REFERENCES worktrees (project_id, id) ON DELETE CASCADE | ||
); | ||
CREATE INDEX "index_settings_files_on_project_id" ON "worktree_settings_files" ("project_id"); | ||
CREATE INDEX "index_settings_files_on_project_id_and_wt_id" ON "worktree_settings_files" ("project_id", "worktree_id"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use super::ProjectId; | ||
use sea_orm::entity::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)] | ||
#[sea_orm(table_name = "worktree_settings_files")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
pub project_id: ProjectId, | ||
#[sea_orm(primary_key)] | ||
pub worktree_id: i64, | ||
#[sea_orm(primary_key)] | ||
pub path: String, | ||
pub content: String, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation {} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.