Skip to content

Commit d3f41b2

Browse files
committed
Include buildfile path in watcher list
1 parent ab34fdd commit d3f41b2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

crates/rust-analyzer/src/reload.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,21 @@ impl GlobalState {
564564
.collect()
565565
};
566566

567+
// Also explicitly watch any build files configured in JSON project files.
568+
for ws in self.workspaces.iter() {
569+
if let ProjectWorkspaceKind::Json(project_json) = &ws.kind {
570+
for (_, krate) in project_json.crates() {
571+
let Some(build) = &krate.build else {
572+
continue;
573+
};
574+
watchers.push(lsp_types::FileSystemWatcher {
575+
glob_pattern: lsp_types::GlobPattern::String(build.build_file.to_string()),
576+
kind: None,
577+
});
578+
}
579+
}
580+
}
581+
567582
watchers.extend(
568583
iter::once(Config::user_config_path())
569584
.chain(self.workspaces.iter().map(|ws| ws.manifest().map(ManifestPath::as_ref)))

0 commit comments

Comments
 (0)