9426: fix: Watch for Cargo.toml and .lock changes r=matklad a=lnicola

Maybe closes #5333

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
bors[bot] 2021-06-29 17:39:00 +00:00 committed by GitHub
commit 1b9b2d1f40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -273,7 +273,13 @@ pub(crate) fn switch_workspaces(&mut self) {
.flat_map(|it| it.to_roots(workspace_build_data.as_ref())) .flat_map(|it| it.to_roots(workspace_build_data.as_ref()))
.filter(|it| it.is_member) .filter(|it| it.is_member)
.flat_map(|root| { .flat_map(|root| {
root.include.into_iter().map(|it| format!("{}/**/*.rs", it.display())) root.include.into_iter().flat_map(|it| {
[
format!("{}/**/*.rs", it.display()),
format!("{}/**/Cargo.toml", it.display()),
format!("{}/**/Cargo.lock", it.display()),
]
})
}) })
.map(|glob_pattern| lsp_types::FileSystemWatcher { .map(|glob_pattern| lsp_types::FileSystemWatcher {
glob_pattern, glob_pattern,