Skip to content

Commit

Permalink
Consider nested configs for settings reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmanila committed Jul 9, 2024
1 parent 9041186 commit d536841
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/ruff_server/src/session/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ impl Index {
}

/// Reloads relevant existing settings files based on a changed settings file path.
/// This does not currently register new settings files.
pub(super) fn reload_settings(&mut self, changed_url: &Url) {
let Ok(changed_path) = changed_url.to_file_path() else {
// Files that don't map to a path can't be a workspace configuration file.
Expand All @@ -310,10 +309,8 @@ impl Index {
return;
};

// TODO: I think this does not correctly reload settings when using `extend` and the extended
// setting isn't in a parent folder.
for (root, settings) in self.settings.range_mut(enclosing_folder.to_path_buf()..) {
if !root.starts_with(enclosing_folder) {
for (root, settings) in &mut self.settings {
if !enclosing_folder.starts_with(root) {
break;
}

Expand Down

0 comments on commit d536841

Please sign in to comment.