Files
oak-gpui/crates/repl/src/jupyter_settings.rs
T
Mikayla MakiandNia 5f8226457e Automate settings registration (#42238)
Release Notes:

- N/A

---------

Co-authored-by: Nia <nia@zed.dev>
2025-11-07 22:27:14 +00:00

29 lines
852 B
Rust

use collections::HashMap;
use editor::EditorSettings;
use gpui::App;
use settings::{RegisterSetting, Settings};
#[derive(Debug, Default, RegisterSetting)]
pub struct JupyterSettings {
pub kernel_selections: HashMap<String, String>,
}
impl JupyterSettings {
pub fn enabled(cx: &App) -> bool {
// In order to avoid a circular dependency between `editor` and `repl` crates,
// we put the `enable` flag on its settings.
// This allows the editor to set up context for key bindings/actions.
EditorSettings::jupyter_enabled(cx)
}
}
impl Settings for JupyterSettings {
fn from_settings(content: &settings::SettingsContent) -> Self {
let jupyter = content.editor.jupyter.clone().unwrap();
Self {
kernel_selections: jupyter.kernel_selections.unwrap_or_default(),
}
}
}