From 2a2997f813a6be1960d539ef59c12408eebec4e2 Mon Sep 17 00:00:00 2001 From: Jane Lewis Date: Wed, 24 Apr 2024 18:08:56 -0700 Subject: [PATCH] resolution_strategy -> configuration_resolution_strategy --- crates/ruff_server/src/session/settings.rs | 14 +++++++------- .../src/session/workspace/ruff_settings.rs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/ruff_server/src/session/settings.rs b/crates/ruff_server/src/session/settings.rs index 724f3b4ba8a999..15fc007624fa74 100644 --- a/crates/ruff_server/src/session/settings.rs +++ b/crates/ruff_server/src/session/settings.rs @@ -38,7 +38,7 @@ pub(crate) struct ResolvedEditorSettings { pub(super) ignore: Option>, pub(super) exclude: Option>, pub(super) line_length: Option, - pub(super) resolution_strategy: ConfigResolutionStrategy, + pub(super) configuration_resolution_strategy: ConfigResolutionStrategy, } /// Determines how multiple conflicting configurations should be resolved - in this @@ -68,7 +68,7 @@ pub(crate) struct ClientSettings { code_action: Option, exclude: Option>, line_length: Option, - resolution_strategy: Option, + configuration_resolution_strategy: Option, } /// This is a direct representation of the workspace settings schema, @@ -268,9 +268,9 @@ impl ResolvedClientSettings { Some(settings.exclude.as_ref()?.clone()) }), line_length: Self::resolve_optional(all_settings, |settings| settings.line_length), - resolution_strategy: Self::resolve_or( + configuration_resolution_strategy: Self::resolve_or( all_settings, - |settings| settings.resolution_strategy, + |settings| settings.configuration_resolution_strategy, ConfigResolutionStrategy::Default, ), }, @@ -564,7 +564,7 @@ mod tests { ignore: None, exclude: None, line_length: None, - resolution_strategy: ConfigResolutionStrategy::Default, + configuration_resolution_strategy: ConfigResolutionStrategy::Default, } } ); @@ -593,7 +593,7 @@ mod tests { ignore: None, exclude: None, line_length: None, - resolution_strategy: ConfigResolutionStrategy::Default, + configuration_resolution_strategy: ConfigResolutionStrategy::Default, } } ); @@ -677,7 +677,7 @@ mod tests { ignore: Some(vec![RuleSelector::from_str("RUF001").unwrap()]), exclude: Some(vec!["third_party".into()]), line_length: Some(LineLength::try_from(80).unwrap()), - resolution_strategy: ConfigResolutionStrategy::Default, + configuration_resolution_strategy: ConfigResolutionStrategy::Default, } } ); diff --git a/crates/ruff_server/src/session/workspace/ruff_settings.rs b/crates/ruff_server/src/session/workspace/ruff_settings.rs index 18167713821961..70b5a02cb711b1 100644 --- a/crates/ruff_server/src/session/workspace/ruff_settings.rs +++ b/crates/ruff_server/src/session/workspace/ruff_settings.rs @@ -117,7 +117,7 @@ impl<'a> ConfigurationTransformer for EditorConfigurationTransformer<'a> { ignore, exclude, line_length, - resolution_strategy, + configuration_resolution_strategy, } = self.0.clone(); let project_root = self.1; @@ -150,7 +150,7 @@ impl<'a> ConfigurationTransformer for EditorConfigurationTransformer<'a> { ..Default::default() }; - match resolution_strategy { + match configuration_resolution_strategy { ConfigResolutionStrategy::Default => { editor_configuration.combine(project_configuration) }