Skip to content

Commit be35392

Browse files
committed
feat(language_server): watch for fmt.configPath file content change
1 parent 9cd7a67 commit be35392

File tree

2 files changed

+374
-47
lines changed

2 files changed

+374
-47
lines changed

crates/oxc_language_server/src/backend.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ impl LanguageServer for Backend {
327327
continue;
328328
};
329329

330-
let (diagnostics, watcher, formatter_activated) =
330+
let (diagnostics, watchers, formatter_activated) =
331331
worker.did_change_configuration(&option.options).await;
332332

333333
if formatter_activated && self.capabilities.get().is_some_and(|c| c.dynamic_formatting)
@@ -344,7 +344,7 @@ impl LanguageServer for Backend {
344344
}
345345
}
346346

347-
if let Some(watcher) = watcher
347+
if let Some(watchers) = watchers
348348
&& self.capabilities.get().is_some_and(|capabilities| capabilities.dynamic_watchers)
349349
{
350350
// remove the old watcher
@@ -357,7 +357,7 @@ impl LanguageServer for Backend {
357357
id: format!("watcher-{}", worker.get_root_uri().as_str()),
358358
method: "workspace/didChangeWatchedFiles".to_string(),
359359
register_options: Some(json!(DidChangeWatchedFilesRegistrationOptions {
360-
watchers: vec![watcher]
360+
watchers
361361
})),
362362
});
363363
}

0 commit comments

Comments
 (0)