Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions crates/oxc_language_server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,7 @@ impl LanguageServer for Backend {
self.init_nested_configs().await;
}

if changed_options.fix_kind() != changed_options.fix_kind() {
self.init_linter_config().await;
self.revalidate_open_files().await;
}

// revalidate the config and all open files
if changed_options.config_path != current_option.config_path {
info!("config path change detected {:?}", &changed_options.config_path);
if Self::needs_linter_restart(current_option, &changed_options) {
self.init_linter_config().await;
self.revalidate_open_files().await;
}
Expand Down Expand Up @@ -527,6 +520,12 @@ impl Backend {
.await;
}

fn needs_linter_restart(old_options: &Options, new_options: &Options) -> bool {
old_options.config_path != new_options.config_path
|| old_options.disable_nested_configs() != new_options.disable_nested_configs()
|| old_options.fix_kind() != new_options.fix_kind()
}

/// Searches inside root_uri recursively for the default oxlint config files
/// and insert them inside the nested configuration
async fn init_nested_configs(&self) {
Expand Down
Loading