Skip to content

Commit 45949d8

Browse files
Update crates/biome_service/src/scanner/watcher.rs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent d7b7d84 commit 45949d8

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

crates/biome_service/src/scanner/watcher.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,20 @@ impl Watcher {
316316
from: &Utf8Path,
317317
to: &Utf8Path,
318318
) -> Result<Vec<Diagnostic>, WorkspaceError> {
319-
if workspace.fs().path_is_file(from) {
320-
workspace.unload_file(from)?;
321-
} else {
322-
workspace.unload_path(from)?;
323-
}
324-
Self::index_path(workspace, to)
319+
fn rename_path(
320+
workspace: &impl WorkspaceWatcherBridge,
321+
from: &Utf8Path,
322+
to: &Utf8Path,
323+
) -> Result<Vec<Diagnostic>, WorkspaceError> {
324+
let mut diagnostics = vec![];
325+
if workspace.fs().path_is_file(from) {
326+
diagnostics.extend(workspace.unload_file(from)?);
327+
} else {
328+
diagnostics.extend(workspace.unload_path(from)?);
329+
}
330+
diagnostics.extend(Self::index_path(workspace, to)?);
331+
Ok(diagnostics)
332+
}
325333
}
326334

327335
/// Reindexes an individual file if the watcher (still) has interest in it.

0 commit comments

Comments
 (0)