mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 15:15:33 +00:00
ruff server
: Editor settings are used by default if no file-based configuration exists (#11266)
## Summary Fixes https://github.com/astral-sh/ruff/issues/11258. This PR fixes the settings resolver to match the expected behavior when file-based configuration is not available. ## Test Plan In a workspace with no file-based configuration, set a setting in your editor and confirm that this setting is used instead of the default.
This commit is contained in:
parent
6587dc1269
commit
c4bf783b85
1 changed files with 9 additions and 1 deletions
|
@ -89,7 +89,15 @@ impl RuffSettingsIndex {
|
|||
)
|
||||
.ok()
|
||||
})
|
||||
.unwrap_or_default();
|
||||
.unwrap_or_else(|| {
|
||||
let default_configuration = ruff_workspace::configuration::Configuration::default();
|
||||
EditorConfigurationTransformer(editor_settings, root)
|
||||
.transform(default_configuration)
|
||||
.into_settings(root)
|
||||
.expect(
|
||||
"editor configuration should merge successfully with default configuration",
|
||||
)
|
||||
});
|
||||
|
||||
Self {
|
||||
index,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue