mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 15:14:32 +00:00
Include buildfile path in watcher list
This commit is contained in:
parent
ab34fdd9f3
commit
fa83d3c414
1 changed files with 17 additions and 0 deletions
|
@ -564,6 +564,23 @@ impl GlobalState {
|
|||
.collect()
|
||||
};
|
||||
|
||||
// Also explicitly watch any build files configured in JSON project files.
|
||||
for ws in self.workspaces.iter() {
|
||||
if let ProjectWorkspaceKind::Json(project_json) = &ws.kind {
|
||||
for (_, krate) in project_json.crates() {
|
||||
let Some(build) = &krate.build else {
|
||||
continue;
|
||||
};
|
||||
watchers.push(lsp_types::FileSystemWatcher {
|
||||
glob_pattern: lsp_types::GlobPattern::String(
|
||||
build.build_file.to_string(),
|
||||
),
|
||||
kind: None,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
watchers.extend(
|
||||
iter::once(Config::user_config_path())
|
||||
.chain(self.workspaces.iter().map(|ws| ws.manifest().map(ManifestPath::as_ref)))
|
||||
|
|
Loading…
Reference in a new issue