Eliminate GPUI View, ViewContext, and WindowContext types (#22632)
There's still a bit more work to do on this, but this PR is compiling (with warnings) after eliminating the key types. When the tasks below are complete, this will be the new narrative for GPUI: - `Entity<T>` - This replaces `View<T>`/`Model<T>`. It represents a unit of state, and if `T` implements `Render`, then `Entity<T>` implements `Element`. - `&mut App` This replaces `AppContext` and represents the app. - `&mut Context<T>` This replaces `ModelContext` and derefs to `App`. It is provided by the framework when updating an entity. - `&mut Window` Broken out of `&mut WindowContext` which no longer exists. Every method that once took `&mut WindowContext` now takes `&mut Window, &mut App` and every method that took `&mut ViewContext<T>` now takes `&mut Window, &mut Context<T>` Not pictured here are the two other failed attempts. It's been quite a month! Tasks: - [x] Remove `View`, `ViewContext`, `WindowContext` and thread through `Window` - [x] [@cole-miller @mikayla-maki] Redraw window when entities change - [x] [@cole-miller @mikayla-maki] Get examples and Zed running - [x] [@cole-miller @mikayla-maki] Fix Zed rendering - [x] [@mikayla-maki] Fix todo! macros and comments - [x] Fix a bug where the editor would not be redrawn because of view caching - [x] remove publicness window.notify() and replace with `AppContext::notify` - [x] remove `observe_new_window_models`, replace with `observe_new_models` with an optional window - [x] Fix a bug where the project panel would not be redrawn because of the wrong refresh() call being used - [x] Fix the tests - [x] Fix warnings by eliminating `Window` params or using `_` - [x] Fix conflicts - [x] Simplify generic code where possible - [x] Rename types - [ ] Update docs ### issues post merge - [x] Issues switching between normal and insert mode - [x] Assistant re-rendering failure - [x] Vim test failures - [x] Mac build issue Release Notes: - N/A --------- Co-authored-by: Antonio Scandurra <me@as-cii.com> Co-authored-by: Cole Miller <cole@zed.dev> Co-authored-by: Mikayla <mikayla@zed.dev> Co-authored-by: Joseph <joseph@zed.dev> Co-authored-by: max <max@zed.dev> Co-authored-by: Michael Sloan <michael@zed.dev> Co-authored-by: Mikayla Maki <mikaylamaki@Mikaylas-MacBook-Pro.local> Co-authored-by: Mikayla <mikayla.c.maki@gmail.com> Co-authored-by: joão <joao@zed.dev>
This commit is contained in:
parent
21b4a0d50e
commit
6fca1d2b0b
648 changed files with 36248 additions and 28208 deletions
|
@ -1,5 +1,5 @@
|
|||
use fs::Fs;
|
||||
use gpui::{AppContext, RenderOnce, SharedString};
|
||||
use gpui::{App, RenderOnce, SharedString};
|
||||
|
||||
use crate::{update_settings_file, Settings};
|
||||
|
||||
|
@ -15,7 +15,7 @@ pub trait EditableSettingControl: RenderOnce {
|
|||
fn name(&self) -> SharedString;
|
||||
|
||||
/// Reads the setting value from the settings.
|
||||
fn read(cx: &AppContext) -> Self::Value;
|
||||
fn read(cx: &App) -> Self::Value;
|
||||
|
||||
/// Applies the given setting file to the settings file contents.
|
||||
///
|
||||
|
@ -23,11 +23,11 @@ pub trait EditableSettingControl: RenderOnce {
|
|||
fn apply(
|
||||
settings: &mut <Self::Settings as Settings>::FileContent,
|
||||
value: Self::Value,
|
||||
cx: &AppContext,
|
||||
cx: &App,
|
||||
);
|
||||
|
||||
/// Writes the given setting value to the settings files.
|
||||
fn write(value: Self::Value, cx: &AppContext) {
|
||||
fn write(value: Self::Value, cx: &App) {
|
||||
let fs = <dyn Fs>::global(cx);
|
||||
|
||||
update_settings_file::<Self::Settings>(fs, cx, move |settings, cx| {
|
||||
|
|
|
@ -4,8 +4,8 @@ use crate::{settings_store::parse_json_with_comments, SettingsAssets};
|
|||
use anyhow::anyhow;
|
||||
use collections::{HashMap, IndexMap};
|
||||
use gpui::{
|
||||
Action, ActionBuildError, AppContext, InvalidKeystrokeError, KeyBinding,
|
||||
KeyBindingContextPredicate, NoAction, SharedString, KEYSTROKE_PARSE_EXPECTED_MESSAGE,
|
||||
Action, ActionBuildError, App, InvalidKeystrokeError, KeyBinding, KeyBindingContextPredicate,
|
||||
NoAction, SharedString, KEYSTROKE_PARSE_EXPECTED_MESSAGE,
|
||||
};
|
||||
use schemars::{
|
||||
gen::{SchemaGenerator, SchemaSettings},
|
||||
|
@ -129,7 +129,7 @@ impl KeymapFile {
|
|||
parse_json_with_comments::<Self>(content)
|
||||
}
|
||||
|
||||
pub fn load_asset(asset_path: &str, cx: &AppContext) -> anyhow::Result<Vec<KeyBinding>> {
|
||||
pub fn load_asset(asset_path: &str, cx: &App) -> anyhow::Result<Vec<KeyBinding>> {
|
||||
match Self::load(asset_str::<SettingsAssets>(asset_path).as_ref(), cx) {
|
||||
KeymapFileLoadResult::Success { key_bindings, .. } => Ok(key_bindings),
|
||||
KeymapFileLoadResult::SomeFailedToLoad { error_message, .. } => Err(anyhow!(
|
||||
|
@ -144,7 +144,7 @@ impl KeymapFile {
|
|||
#[cfg(feature = "test-support")]
|
||||
pub fn load_asset_allow_partial_failure(
|
||||
asset_path: &str,
|
||||
cx: &AppContext,
|
||||
cx: &App,
|
||||
) -> anyhow::Result<Vec<KeyBinding>> {
|
||||
match Self::load(asset_str::<SettingsAssets>(asset_path).as_ref(), cx) {
|
||||
KeymapFileLoadResult::SomeFailedToLoad {
|
||||
|
@ -162,7 +162,7 @@ impl KeymapFile {
|
|||
}
|
||||
|
||||
#[cfg(feature = "test-support")]
|
||||
pub fn load_panic_on_failure(content: &str, cx: &AppContext) -> Vec<KeyBinding> {
|
||||
pub fn load_panic_on_failure(content: &str, cx: &App) -> Vec<KeyBinding> {
|
||||
match Self::load(content, cx) {
|
||||
KeymapFileLoadResult::Success { key_bindings } => key_bindings,
|
||||
KeymapFileLoadResult::SomeFailedToLoad { error_message, .. } => {
|
||||
|
@ -174,7 +174,7 @@ impl KeymapFile {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn load(content: &str, cx: &AppContext) -> KeymapFileLoadResult {
|
||||
pub fn load(content: &str, cx: &App) -> KeymapFileLoadResult {
|
||||
let key_equivalents = crate::key_equivalents::get_key_equivalents(&cx.keyboard_layout());
|
||||
|
||||
if content.is_empty() {
|
||||
|
@ -294,7 +294,7 @@ impl KeymapFile {
|
|||
action: &KeymapAction,
|
||||
context: Option<Rc<KeyBindingContextPredicate>>,
|
||||
key_equivalents: Option<&HashMap<char, char>>,
|
||||
cx: &AppContext,
|
||||
cx: &App,
|
||||
) -> std::result::Result<KeyBinding, String> {
|
||||
let (build_result, action_input_string) = match &action.0 {
|
||||
Value::Array(items) => {
|
||||
|
@ -367,7 +367,7 @@ impl KeymapFile {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn generate_json_schema_for_registered_actions(cx: &mut AppContext) -> Value {
|
||||
pub fn generate_json_schema_for_registered_actions(cx: &mut App) -> Value {
|
||||
let mut generator = SchemaSettings::draft07()
|
||||
.with(|settings| settings.option_add_null_type = false)
|
||||
.into_generator();
|
||||
|
|
|
@ -5,7 +5,7 @@ mod keymap_file;
|
|||
mod settings_file;
|
||||
mod settings_store;
|
||||
|
||||
use gpui::AppContext;
|
||||
use gpui::App;
|
||||
use rust_embed::RustEmbed;
|
||||
use std::{borrow::Cow, fmt, str};
|
||||
use util::asset_str;
|
||||
|
@ -60,7 +60,7 @@ impl fmt::Display for WorktreeId {
|
|||
#[exclude = "*.DS_Store"]
|
||||
pub struct SettingsAssets;
|
||||
|
||||
pub fn init(cx: &mut AppContext) {
|
||||
pub fn init(cx: &mut App) {
|
||||
let mut settings = SettingsStore::new(cx);
|
||||
settings
|
||||
.set_default_settings(&default_settings(), cx)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::{settings_store::SettingsStore, Settings};
|
||||
use fs::Fs;
|
||||
use futures::{channel::mpsc, StreamExt};
|
||||
use gpui::{AppContext, BackgroundExecutor, ReadGlobal, UpdateGlobal};
|
||||
use gpui::{App, BackgroundExecutor, ReadGlobal, UpdateGlobal};
|
||||
use std::{path::PathBuf, sync::Arc, time::Duration};
|
||||
use util::ResultExt;
|
||||
|
||||
|
@ -65,8 +65,8 @@ pub fn watch_config_file(
|
|||
|
||||
pub fn handle_settings_file_changes(
|
||||
mut user_settings_file_rx: mpsc::UnboundedReceiver<String>,
|
||||
cx: &mut AppContext,
|
||||
settings_changed: impl Fn(Option<anyhow::Error>, &mut AppContext) + 'static,
|
||||
cx: &mut App,
|
||||
settings_changed: impl Fn(Option<anyhow::Error>, &mut App) + 'static,
|
||||
) {
|
||||
let user_settings_content = cx
|
||||
.background_executor()
|
||||
|
@ -85,7 +85,7 @@ pub fn handle_settings_file_changes(
|
|||
log::error!("Failed to load user settings: {err}");
|
||||
}
|
||||
settings_changed(result.err(), cx);
|
||||
cx.refresh();
|
||||
cx.refresh_windows();
|
||||
});
|
||||
if result.is_err() {
|
||||
break; // App dropped
|
||||
|
@ -97,8 +97,8 @@ pub fn handle_settings_file_changes(
|
|||
|
||||
pub fn update_settings_file<T: Settings>(
|
||||
fs: Arc<dyn Fs>,
|
||||
cx: &AppContext,
|
||||
update: impl 'static + Send + FnOnce(&mut T::FileContent, &AppContext),
|
||||
cx: &App,
|
||||
update: impl 'static + Send + FnOnce(&mut T::FileContent, &App),
|
||||
) {
|
||||
SettingsStore::global(cx).update_settings_file::<T>(fs, update);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use anyhow::{anyhow, Context, Result};
|
||||
use anyhow::{anyhow, Context as _, Result};
|
||||
use collections::{btree_map, hash_map, BTreeMap, HashMap};
|
||||
use ec4rs::{ConfigParser, PropertiesSource, Section};
|
||||
use fs::Fs;
|
||||
use futures::{channel::mpsc, future::LocalBoxFuture, FutureExt, StreamExt};
|
||||
use gpui::{AppContext, AsyncAppContext, BorrowAppContext, Global, Task, UpdateGlobal};
|
||||
use gpui::{App, AsyncAppContext, BorrowAppContext, Global, Task, UpdateGlobal};
|
||||
use paths::{local_settings_file_relative_path, EDITORCONFIG_NAME};
|
||||
use schemars::{gen::SchemaGenerator, schema::RootSchema, JsonSchema};
|
||||
use serde::{de::DeserializeOwned, Deserialize as _, Serialize};
|
||||
|
@ -45,14 +45,14 @@ pub trait Settings: 'static + Send + Sync {
|
|||
|
||||
/// The logic for combining together values from one or more JSON files into the
|
||||
/// final value for this setting.
|
||||
fn load(sources: SettingsSources<Self::FileContent>, cx: &mut AppContext) -> Result<Self>
|
||||
fn load(sources: SettingsSources<Self::FileContent>, cx: &mut App) -> Result<Self>
|
||||
where
|
||||
Self: Sized;
|
||||
|
||||
fn json_schema(
|
||||
generator: &mut SchemaGenerator,
|
||||
_: &SettingsJsonSchemaParams,
|
||||
_: &AppContext,
|
||||
_: &App,
|
||||
) -> RootSchema {
|
||||
generator.root_schema_for::<Self::FileContent>()
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ pub trait Settings: 'static + Send + Sync {
|
|||
}
|
||||
|
||||
#[track_caller]
|
||||
fn register(cx: &mut AppContext)
|
||||
fn register(cx: &mut App)
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ pub trait Settings: 'static + Send + Sync {
|
|||
}
|
||||
|
||||
#[track_caller]
|
||||
fn get<'a>(path: Option<SettingsLocation>, cx: &'a AppContext) -> &'a Self
|
||||
fn get<'a>(path: Option<SettingsLocation>, cx: &'a App) -> &'a Self
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
|
@ -80,7 +80,7 @@ pub trait Settings: 'static + Send + Sync {
|
|||
}
|
||||
|
||||
#[track_caller]
|
||||
fn get_global(cx: &AppContext) -> &Self
|
||||
fn get_global(cx: &App) -> &Self
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
|
@ -96,7 +96,7 @@ pub trait Settings: 'static + Send + Sync {
|
|||
}
|
||||
|
||||
#[track_caller]
|
||||
fn override_global(settings: Self, cx: &mut AppContext)
|
||||
fn override_global(settings: Self, cx: &mut App)
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
|
@ -225,7 +225,7 @@ trait AnySettingValue: 'static + Send + Sync {
|
|||
fn load_setting(
|
||||
&self,
|
||||
sources: SettingsSources<DeserializedSetting>,
|
||||
cx: &mut AppContext,
|
||||
cx: &mut App,
|
||||
) -> Result<Box<dyn Any>>;
|
||||
fn value_for_path(&self, path: Option<SettingsLocation>) -> &dyn Any;
|
||||
fn set_global_value(&mut self, value: Box<dyn Any>);
|
||||
|
@ -234,14 +234,14 @@ trait AnySettingValue: 'static + Send + Sync {
|
|||
&self,
|
||||
generator: &mut SchemaGenerator,
|
||||
_: &SettingsJsonSchemaParams,
|
||||
cx: &AppContext,
|
||||
cx: &App,
|
||||
) -> RootSchema;
|
||||
}
|
||||
|
||||
struct DeserializedSetting(Box<dyn Any>);
|
||||
|
||||
impl SettingsStore {
|
||||
pub fn new(cx: &AppContext) -> Self {
|
||||
pub fn new(cx: &App) -> Self {
|
||||
let (setting_file_updates_tx, mut setting_file_updates_rx) = mpsc::unbounded();
|
||||
Self {
|
||||
setting_values: Default::default(),
|
||||
|
@ -269,7 +269,7 @@ impl SettingsStore {
|
|||
}
|
||||
|
||||
/// Add a new type of setting to the store.
|
||||
pub fn register_setting<T: Settings>(&mut self, cx: &mut AppContext) {
|
||||
pub fn register_setting<T: Settings>(&mut self, cx: &mut App) {
|
||||
let setting_type_id = TypeId::of::<T>();
|
||||
let entry = self.setting_values.entry(setting_type_id);
|
||||
|
||||
|
@ -363,7 +363,7 @@ impl SettingsStore {
|
|||
}
|
||||
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub fn test(cx: &mut AppContext) -> Self {
|
||||
pub fn test(cx: &mut App) -> Self {
|
||||
let mut this = Self::new(cx);
|
||||
this.set_default_settings(&crate::test_settings(), cx)
|
||||
.unwrap();
|
||||
|
@ -378,7 +378,7 @@ impl SettingsStore {
|
|||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub fn update_user_settings<T: Settings>(
|
||||
&mut self,
|
||||
cx: &mut AppContext,
|
||||
cx: &mut App,
|
||||
update: impl FnOnce(&mut T::FileContent),
|
||||
) {
|
||||
let old_text = serde_json::to_string(&self.raw_user_settings).unwrap();
|
||||
|
@ -403,7 +403,7 @@ impl SettingsStore {
|
|||
pub fn update_settings_file<T: Settings>(
|
||||
&self,
|
||||
fs: Arc<dyn Fs>,
|
||||
update: impl 'static + Send + FnOnce(&mut T::FileContent, &AppContext),
|
||||
update: impl 'static + Send + FnOnce(&mut T::FileContent, &App),
|
||||
) {
|
||||
self.setting_file_updates_tx
|
||||
.unbounded_send(Box::new(move |cx: AsyncAppContext| {
|
||||
|
@ -531,7 +531,7 @@ impl SettingsStore {
|
|||
pub fn set_default_settings(
|
||||
&mut self,
|
||||
default_settings_content: &str,
|
||||
cx: &mut AppContext,
|
||||
cx: &mut App,
|
||||
) -> Result<()> {
|
||||
let settings: serde_json::Value = parse_json_with_comments(default_settings_content)?;
|
||||
if settings.is_object() {
|
||||
|
@ -544,11 +544,7 @@ impl SettingsStore {
|
|||
}
|
||||
|
||||
/// Sets the user settings via a JSON string.
|
||||
pub fn set_user_settings(
|
||||
&mut self,
|
||||
user_settings_content: &str,
|
||||
cx: &mut AppContext,
|
||||
) -> Result<()> {
|
||||
pub fn set_user_settings(&mut self, user_settings_content: &str, cx: &mut App) -> Result<()> {
|
||||
let settings: serde_json::Value = if user_settings_content.is_empty() {
|
||||
parse_json_with_comments("{}")?
|
||||
} else {
|
||||
|
@ -564,7 +560,7 @@ impl SettingsStore {
|
|||
pub fn set_server_settings(
|
||||
&mut self,
|
||||
server_settings_content: &str,
|
||||
cx: &mut AppContext,
|
||||
cx: &mut App,
|
||||
) -> Result<()> {
|
||||
let settings: Option<serde_json::Value> = if server_settings_content.is_empty() {
|
||||
None
|
||||
|
@ -591,7 +587,7 @@ impl SettingsStore {
|
|||
directory_path: Arc<Path>,
|
||||
kind: LocalSettingsKind,
|
||||
settings_content: Option<&str>,
|
||||
cx: &mut AppContext,
|
||||
cx: &mut App,
|
||||
) -> std::result::Result<(), InvalidSettingsError> {
|
||||
let mut zed_settings_changed = false;
|
||||
match (
|
||||
|
@ -683,11 +679,7 @@ impl SettingsStore {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn set_extension_settings<T: Serialize>(
|
||||
&mut self,
|
||||
content: T,
|
||||
cx: &mut AppContext,
|
||||
) -> Result<()> {
|
||||
pub fn set_extension_settings<T: Serialize>(&mut self, content: T, cx: &mut App) -> Result<()> {
|
||||
let settings: serde_json::Value = serde_json::to_value(content)?;
|
||||
anyhow::ensure!(settings.is_object(), "settings must be an object");
|
||||
self.raw_extension_settings = settings;
|
||||
|
@ -696,7 +688,7 @@ impl SettingsStore {
|
|||
}
|
||||
|
||||
/// Add or remove a set of local settings via a JSON string.
|
||||
pub fn clear_local_settings(&mut self, root_id: WorktreeId, cx: &mut AppContext) -> Result<()> {
|
||||
pub fn clear_local_settings(&mut self, root_id: WorktreeId, cx: &mut App) -> Result<()> {
|
||||
self.raw_local_settings
|
||||
.retain(|(worktree_id, _), _| worktree_id != &root_id);
|
||||
self.recompute_values(Some((root_id, "".as_ref())), cx)?;
|
||||
|
@ -738,7 +730,7 @@ impl SettingsStore {
|
|||
pub fn json_schema(
|
||||
&self,
|
||||
schema_params: &SettingsJsonSchemaParams,
|
||||
cx: &AppContext,
|
||||
cx: &App,
|
||||
) -> serde_json::Value {
|
||||
use schemars::{
|
||||
gen::SchemaSettings,
|
||||
|
@ -845,7 +837,7 @@ impl SettingsStore {
|
|||
fn recompute_values(
|
||||
&mut self,
|
||||
changed_local_path: Option<(WorktreeId, &Path)>,
|
||||
cx: &mut AppContext,
|
||||
cx: &mut App,
|
||||
) -> std::result::Result<(), InvalidSettingsError> {
|
||||
// Reload the global and local values for every setting.
|
||||
let mut project_settings_stack = Vec::<DeserializedSetting>::new();
|
||||
|
@ -1054,7 +1046,7 @@ impl<T: Settings> AnySettingValue for SettingValue<T> {
|
|||
fn load_setting(
|
||||
&self,
|
||||
values: SettingsSources<DeserializedSetting>,
|
||||
cx: &mut AppContext,
|
||||
cx: &mut App,
|
||||
) -> Result<Box<dyn Any>> {
|
||||
Ok(Box::new(T::load(
|
||||
SettingsSources {
|
||||
|
@ -1127,7 +1119,7 @@ impl<T: Settings> AnySettingValue for SettingValue<T> {
|
|||
&self,
|
||||
generator: &mut SchemaGenerator,
|
||||
params: &SettingsJsonSchemaParams,
|
||||
cx: &AppContext,
|
||||
cx: &App,
|
||||
) -> RootSchema {
|
||||
T::json_schema(generator, params, cx)
|
||||
}
|
||||
|
@ -1352,7 +1344,7 @@ mod tests {
|
|||
use unindent::Unindent;
|
||||
|
||||
#[gpui::test]
|
||||
fn test_settings_store_basic(cx: &mut AppContext) {
|
||||
fn test_settings_store_basic(cx: &mut App) {
|
||||
let mut store = SettingsStore::new(cx);
|
||||
store.register_setting::<UserSettings>(cx);
|
||||
store.register_setting::<TurboSetting>(cx);
|
||||
|
@ -1484,7 +1476,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[gpui::test]
|
||||
fn test_setting_store_assign_json_before_register(cx: &mut AppContext) {
|
||||
fn test_setting_store_assign_json_before_register(cx: &mut App) {
|
||||
let mut store = SettingsStore::new(cx);
|
||||
store
|
||||
.set_default_settings(
|
||||
|
@ -1527,7 +1519,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[gpui::test]
|
||||
fn test_setting_store_update(cx: &mut AppContext) {
|
||||
fn test_setting_store_update(cx: &mut App) {
|
||||
let mut store = SettingsStore::new(cx);
|
||||
store.register_setting::<MultiKeySettings>(cx);
|
||||
store.register_setting::<UserSettings>(cx);
|
||||
|
@ -1651,7 +1643,7 @@ mod tests {
|
|||
old_json: String,
|
||||
update: fn(&mut T::FileContent),
|
||||
expected_new_json: String,
|
||||
cx: &mut AppContext,
|
||||
cx: &mut App,
|
||||
) {
|
||||
store.set_user_settings(&old_json, cx).ok();
|
||||
let edits = store.edits_for_update::<T>(&old_json, update);
|
||||
|
@ -1680,7 +1672,7 @@ mod tests {
|
|||
const KEY: Option<&'static str> = Some("user");
|
||||
type FileContent = UserSettingsJson;
|
||||
|
||||
fn load(sources: SettingsSources<Self::FileContent>, _: &mut AppContext) -> Result<Self> {
|
||||
fn load(sources: SettingsSources<Self::FileContent>, _: &mut App) -> Result<Self> {
|
||||
sources.json_merge()
|
||||
}
|
||||
}
|
||||
|
@ -1692,7 +1684,7 @@ mod tests {
|
|||
const KEY: Option<&'static str> = Some("turbo");
|
||||
type FileContent = Option<bool>;
|
||||
|
||||
fn load(sources: SettingsSources<Self::FileContent>, _: &mut AppContext) -> Result<Self> {
|
||||
fn load(sources: SettingsSources<Self::FileContent>, _: &mut App) -> Result<Self> {
|
||||
sources.json_merge()
|
||||
}
|
||||
}
|
||||
|
@ -1716,7 +1708,7 @@ mod tests {
|
|||
|
||||
type FileContent = MultiKeySettingsJson;
|
||||
|
||||
fn load(sources: SettingsSources<Self::FileContent>, _: &mut AppContext) -> Result<Self> {
|
||||
fn load(sources: SettingsSources<Self::FileContent>, _: &mut App) -> Result<Self> {
|
||||
sources.json_merge()
|
||||
}
|
||||
}
|
||||
|
@ -1745,7 +1737,7 @@ mod tests {
|
|||
|
||||
type FileContent = JournalSettingsJson;
|
||||
|
||||
fn load(sources: SettingsSources<Self::FileContent>, _: &mut AppContext) -> Result<Self> {
|
||||
fn load(sources: SettingsSources<Self::FileContent>, _: &mut App) -> Result<Self> {
|
||||
sources.json_merge()
|
||||
}
|
||||
}
|
||||
|
@ -1767,7 +1759,7 @@ mod tests {
|
|||
|
||||
type FileContent = Self;
|
||||
|
||||
fn load(sources: SettingsSources<Self::FileContent>, _: &mut AppContext) -> Result<Self> {
|
||||
fn load(sources: SettingsSources<Self::FileContent>, _: &mut App) -> Result<Self> {
|
||||
sources.json_merge()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue