Skip to content

Commit

Permalink
resolution_strategy -> configuration_resolution_strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
snowsignal committed Apr 25, 2024
1 parent c3c14ff commit 2a2997f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions crates/ruff_server/src/session/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub(crate) struct ResolvedEditorSettings {
pub(super) ignore: Option<Vec<RuleSelector>>,
pub(super) exclude: Option<Vec<String>>,
pub(super) line_length: Option<LineLength>,
pub(super) resolution_strategy: ConfigResolutionStrategy,
pub(super) configuration_resolution_strategy: ConfigResolutionStrategy,
}

/// Determines how multiple conflicting configurations should be resolved - in this
Expand Down Expand Up @@ -68,7 +68,7 @@ pub(crate) struct ClientSettings {
code_action: Option<CodeActionOptions>,
exclude: Option<Vec<String>>,
line_length: Option<LineLength>,
resolution_strategy: Option<ConfigResolutionStrategy>,
configuration_resolution_strategy: Option<ConfigResolutionStrategy>,
}

/// This is a direct representation of the workspace settings schema,
Expand Down Expand Up @@ -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,
),
},
Expand Down Expand Up @@ -564,7 +564,7 @@ mod tests {
ignore: None,
exclude: None,
line_length: None,
resolution_strategy: ConfigResolutionStrategy::Default,
configuration_resolution_strategy: ConfigResolutionStrategy::Default,
}
}
);
Expand Down Expand Up @@ -593,7 +593,7 @@ mod tests {
ignore: None,
exclude: None,
line_length: None,
resolution_strategy: ConfigResolutionStrategy::Default,
configuration_resolution_strategy: ConfigResolutionStrategy::Default,
}
}
);
Expand Down Expand Up @@ -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,
}
}
);
Expand Down
4 changes: 2 additions & 2 deletions crates/ruff_server/src/session/workspace/ruff_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 2a2997f

Please sign in to comment.