Files
oak-gpui/crates/repl/src/jupyter_settings.rs
T
Conrad Irwin 1d1c799b4b Reland "Remove cx from ThemeSettings" (#39720)
- **Reapply "Remove cx from ThemeSettings (#38836)" (#39691)**
- **Fix theme loading races**

Closes #ISSUE

Release Notes:

- N/A
2025-10-08 17:36:52 +02:00

29 lines
816 B
Rust

use collections::HashMap;
use editor::EditorSettings;
use gpui::App;
use settings::Settings;
#[derive(Debug, Default)]
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(),
}
}
}