File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
crates/oxc_language_server/src Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -148,14 +148,7 @@ impl LanguageServer for Backend {
148148 self . init_nested_configs ( ) . await ;
149149 }
150150
151- if changed_options. fix_kind ( ) != changed_options. fix_kind ( ) {
152- self . init_linter_config ( ) . await ;
153- self . revalidate_open_files ( ) . await ;
154- }
155-
156- // revalidate the config and all open files
157- if changed_options. config_path != current_option. config_path {
158- info ! ( "config path change detected {:?}" , & changed_options. config_path) ;
151+ if Self :: needs_linter_restart ( current_option, & changed_options) {
159152 self . init_linter_config ( ) . await ;
160153 self . revalidate_open_files ( ) . await ;
161154 }
@@ -527,6 +520,12 @@ impl Backend {
527520 . await ;
528521 }
529522
523+ fn needs_linter_restart ( old_options : & Options , new_options : & Options ) -> bool {
524+ old_options. config_path != new_options. config_path
525+ || old_options. disable_nested_configs ( ) != new_options. disable_nested_configs ( )
526+ || old_options. fix_kind ( ) != new_options. fix_kind ( )
527+ }
528+
530529 /// Searches inside root_uri recursively for the default oxlint config files
531530 /// and insert them inside the nested configuration
532531 async fn init_nested_configs ( & self ) {
You can’t perform that action at this time.
0 commit comments