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.

Rename settings::register_setting -> settings::register

Max Brunsfeld258723566f72
diff --git a/crates/auto_update/src/auto_update.rs b/crates/auto_update/src/auto_update.rs
index 7353c2597f4..822886b5801 100644
--- a/crates/auto_update/src/auto_update.rs
+++ b/crates/auto_update/src/auto_update.rs
@@ -77,7 +77,7 @@ impl Setting for AutoUpdateSetting {
}
pub fn init(http_client: Arc<dyn HttpClient>, server_url: String, cx: &mut AppContext) {
- settings::register_setting::<AutoUpdateSetting>(cx);
+ settings::register::<AutoUpdateSetting>(cx);
if let Some(version) = (*ZED_APP_VERSION).or_else(|| cx.platform().app_version().ok()) {
let auto_updater = cx.add_model(|cx| {
diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs
index 8950b51a458..311d9a2b887 100644
--- a/crates/client/src/client.rs
+++ b/crates/client/src/client.rs
@@ -71,7 +71,7 @@ pub const CONNECTION_TIMEOUT: Duration = Duration::from_secs(5);
actions!(client, [SignIn, SignOut]);
pub fn init_settings(cx: &mut AppContext) {
- settings::register_setting::<TelemetrySettings>(cx);
+ settings::register::<TelemetrySettings>(cx);
}
pub fn init(client: &Arc<Client>, cx: &mut AppContext) {
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index 9eed6c655ea..ee4f19b0a10 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -290,7 +290,7 @@ pub enum Direction {
}
pub fn init_settings(cx: &mut AppContext) {
- settings::register_setting::<EditorSettings>(cx);
+ settings::register::<EditorSettings>(cx);
}
pub fn init(cx: &mut AppContext) {
diff --git a/crates/journal/src/journal.rs b/crates/journal/src/journal.rs
index 74868e2f91f..99fe997dc5e 100644
--- a/crates/journal/src/journal.rs
+++ b/crates/journal/src/journal.rs
@@ -47,7 +47,7 @@ impl settings::Setting for JournalSettings {
}
pub fn init(app_state: Arc<AppState>, cx: &mut AppContext) {
- settings::register_setting::<JournalSettings>(cx);
+ settings::register::<JournalSettings>(cx);
cx.add_global_action(move |_: &NewJournalEntry, cx| new_journal_entry(app_state.clone(), cx));
}
diff --git a/crates/language/src/language_settings.rs b/crates/language/src/language_settings.rs
index cd932ce791f..b47982819a5 100644
--- a/crates/language/src/language_settings.rs
+++ b/crates/language/src/language_settings.rs
@@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize};
use std::{num::NonZeroU32, path::Path, sync::Arc};
pub fn init(cx: &mut AppContext) {
- settings::register_setting::<AllLanguageSettings>(cx);
+ settings::register::<AllLanguageSettings>(cx);
}
pub fn language_settings<'a>(language: Option<&str>, cx: &'a AppContext) -> &'a LanguageSettings {
diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs
index cdfe35f2685..13809622f9e 100644
--- a/crates/project/src/project.rs
+++ b/crates/project/src/project.rs
@@ -390,7 +390,7 @@ impl FormatTrigger {
impl Project {
pub fn init_settings(cx: &mut AppContext) {
- settings::register_setting::<ProjectSettings>(cx);
+ settings::register::<ProjectSettings>(cx);
}
pub fn init(client: &Arc<Client>, cx: &mut AppContext) {
diff --git a/crates/settings/src/settings_file.rs b/crates/settings/src/settings_file.rs
index 2f71d5b9afc..79e0d1eb317 100644
--- a/crates/settings/src/settings_file.rs
+++ b/crates/settings/src/settings_file.rs
@@ -7,7 +7,7 @@ use gpui::{executor::Background, AppContext, AssetSource};
use std::{borrow::Cow, io::ErrorKind, path::PathBuf, str, sync::Arc, time::Duration};
use util::{paths, ResultExt};
-pub fn register_setting<T: Setting>(cx: &mut AppContext) {
+pub fn register<T: Setting>(cx: &mut AppContext) {
cx.update_global::<SettingsStore, _, _>(|store, cx| {
store.register_setting::<T>(cx);
});
diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs
index 412e9fb1daf..728f2e348f2 100644
--- a/crates/terminal/src/terminal.rs
+++ b/crates/terminal/src/terminal.rs
@@ -116,7 +116,7 @@ impl EventListener for ZedListener {
}
pub fn init(cx: &mut AppContext) {
- settings::register_setting::<TerminalSettings>(cx);
+ settings::register::<TerminalSettings>(cx);
}
#[derive(Deserialize)]
diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs
index aa8e37814f5..d014179a079 100644
--- a/crates/theme/src/theme.rs
+++ b/crates/theme/src/theme.rs
@@ -22,7 +22,7 @@ pub fn current(cx: &AppContext) -> Arc<Theme> {
pub fn init(source: impl AssetSource, cx: &mut AppContext) {
cx.set_global(ThemeRegistry::new(source, cx.font_cache().clone()));
- settings::register_setting::<ThemeSettings>(cx);
+ settings::register::<ThemeSettings>(cx);
}
#[derive(Deserialize, Default)]
diff --git a/crates/vim/src/vim.rs b/crates/vim/src/vim.rs
index efb339eed75..d10ec5e824b 100644
--- a/crates/vim/src/vim.rs
+++ b/crates/vim/src/vim.rs
@@ -42,7 +42,7 @@ actions!(vim, [Tab, Enter]);
impl_actions!(vim, [Number, SwitchMode, PushOperator]);
pub fn init(cx: &mut AppContext) {
- settings::register_setting::<VimModeSetting>(cx);
+ settings::register::<VimModeSetting>(cx);
editor_events::init(cx);
normal::init(cx);
diff --git a/crates/welcome/src/welcome.rs b/crates/welcome/src/welcome.rs
index 89b4e42cbbe..000c2fd8d97 100644
--- a/crates/welcome/src/welcome.rs
+++ b/crates/welcome/src/welcome.rs
@@ -20,7 +20,7 @@ pub use base_keymap_setting::BaseKeymap;
pub const FIRST_OPEN: &str = "first_open";
pub fn init(cx: &mut AppContext) {
- settings::register_setting::<BaseKeymap>(cx);
+ settings::register::<BaseKeymap>(cx);
cx.add_action(|workspace: &mut Workspace, _: &Welcome, cx| {
let welcome_page = cx.add_view(|cx| WelcomePage::new(workspace, cx));
diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs
index 282daf8d8f8..8ca6358f9ae 100644
--- a/crates/workspace/src/workspace.rs
+++ b/crates/workspace/src/workspace.rs
@@ -185,7 +185,7 @@ pub type WorkspaceId = i64;
impl_actions!(workspace, [ActivatePane]);
pub fn init_settings(cx: &mut AppContext) {
- settings::register_setting::<WorkspaceSettings>(cx);
+ settings::register::<WorkspaceSettings>(cx);
}
pub fn init(app_state: Arc<AppState>, cx: &mut AppContext) {