Automate settings registration (#42238)
Release Notes: - N/A --------- Co-authored-by: Nia <nia@zed.dev>
This commit is contained in:
@@ -2,9 +2,9 @@ use collections::HashMap;
|
||||
|
||||
use editor::EditorSettings;
|
||||
use gpui::App;
|
||||
use settings::Settings;
|
||||
use settings::{RegisterSetting, Settings};
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
#[derive(Debug, Default, RegisterSetting)]
|
||||
pub struct JupyterSettings {
|
||||
pub kernel_selections: HashMap<String, String>,
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ use async_dispatcher::{Dispatcher, Runnable, set_dispatcher};
|
||||
use gpui::{App, PlatformDispatcher};
|
||||
use project::Fs;
|
||||
pub use runtimelib::ExecutionState;
|
||||
use settings::Settings as _;
|
||||
|
||||
pub use crate::jupyter_settings::JupyterSettings;
|
||||
pub use crate::kernels::{Kernel, KernelSpecification, KernelStatus};
|
||||
@@ -31,9 +30,6 @@ pub const KERNEL_DOCS_URL: &str = "https://zed.dev/docs/repl#changing-kernels";
|
||||
|
||||
pub fn init(fs: Arc<dyn Fs>, cx: &mut App) {
|
||||
set_dispatcher(zed_dispatcher(cx));
|
||||
JupyterSettings::register(cx);
|
||||
::editor::init_settings(cx);
|
||||
ReplSettings::register(cx);
|
||||
repl_sessions_ui::init(cx);
|
||||
ReplStore::init(fs, cx);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use settings::Settings;
|
||||
use settings::{RegisterSetting, Settings};
|
||||
|
||||
/// Settings for configuring REPL display and behavior.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, Debug, RegisterSetting)]
|
||||
pub struct ReplSettings {
|
||||
/// Maximum number of lines to keep in REPL's scrollback buffer.
|
||||
/// Clamped with [4, 256] range.
|
||||
|
||||
Reference in New Issue
Block a user