Automate settings registration (#42238)

Release Notes:

- N/A

---------

Co-authored-by: Nia <nia@zed.dev>
This commit is contained in:
Mikayla Maki
2025-11-07 22:27:14 +00:00
committed by GitHub
co-authored by Nia
parent 309947aa53
commit 5f8226457e
161 changed files with 196 additions and 599 deletions
@@ -34,8 +34,6 @@ use workspace::{
use zed_actions::{OpenRecent, OpenRemote};
pub fn init(cx: &mut App) {
SshSettings::register(cx);
#[cfg(target_os = "windows")]
cx.on_action(|open_wsl: &zed_actions::wsl_actions::OpenFolderInWsl, cx| {
let create_new_window = open_wsl.create_new_window;
@@ -762,10 +760,9 @@ impl Render for MatchTooltip {
mod tests {
use std::path::PathBuf;
use dap::debugger_settings::DebuggerSettings;
use editor::Editor;
use gpui::{TestAppContext, UpdateGlobal, WindowHandle};
use project::Project;
use serde_json::json;
use settings::SettingsStore;
use util::path;
@@ -911,12 +908,8 @@ mod tests {
fn init_test(cx: &mut TestAppContext) -> Arc<AppState> {
cx.update(|cx| {
let state = AppState::test(cx);
language::init(cx);
crate::init(cx);
editor::init(cx);
workspace::init_settings(cx);
DebuggerSettings::register(cx);
Project::init_settings(cx);
state
})
}
@@ -23,7 +23,7 @@ use remote::{
SshConnectionOptions,
};
pub use settings::SshConnection;
use settings::{ExtendingVec, Settings, WslConnection};
use settings::{ExtendingVec, RegisterSetting, Settings, WslConnection};
use theme::ThemeSettings;
use ui::{
ActiveTheme, Color, CommonAnimationExt, Context, Icon, IconName, IconSize, InteractiveElement,
@@ -32,6 +32,7 @@ use ui::{
use util::paths::PathWithPosition;
use workspace::{AppState, ModalView, Workspace};
#[derive(RegisterSetting)]
pub struct SshSettings {
pub ssh_connections: ExtendingVec<SshConnection>,
pub wsl_connections: ExtendingVec<WslConnection>,