Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit d894da1

Browse files
committed
Watch for target directory getting deleted
Forces a rebuild on `cargo clean`
1 parent 1848d58 commit d894da1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/actions/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ impl ActionHandler {
121121
const WATCH_ID: &'static str = "rls-watch";
122122
// TODO we should watch for workspace Cargo.tomls too
123123
let pattern = format!("{}/Cargo{{.toml,.lock}}", self.current_project.to_str().unwrap());
124+
let target_pattern = format!("{}/target", self.current_project.to_str().unwrap());
125+
// For target, we only watch if it gets deleted.
124126
let options = json!({
125-
"watchers": [{ "globPattern": pattern }]
127+
"watchers": [{ "globPattern": pattern }, { "globPattern": target_pattern, "kind": 4 }]
126128
});
127129
let output = serde_json::to_string(
128130
&RequestMessage::new(out.provide_id(),

0 commit comments

Comments
 (0)