diff options
Diffstat (limited to 'crates/ra_cargo_watch')
-rw-r--r-- | crates/ra_cargo_watch/src/conv.rs | 2 | ||||
-rw-r--r-- | crates/ra_cargo_watch/src/lib.rs | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/crates/ra_cargo_watch/src/conv.rs b/crates/ra_cargo_watch/src/conv.rs index ac0f1d28a..8fba400ae 100644 --- a/crates/ra_cargo_watch/src/conv.rs +++ b/crates/ra_cargo_watch/src/conv.rs | |||
@@ -117,7 +117,7 @@ fn is_deprecated(rd: &RustDiagnostic) -> bool { | |||
117 | } | 117 | } |
118 | } | 118 | } |
119 | 119 | ||
120 | #[derive(Debug)] | 120 | #[derive(Clone, Debug)] |
121 | pub struct SuggestedFix { | 121 | pub struct SuggestedFix { |
122 | pub title: String, | 122 | pub title: String, |
123 | pub location: Location, | 123 | pub location: Location, |
diff --git a/crates/ra_cargo_watch/src/lib.rs b/crates/ra_cargo_watch/src/lib.rs index 7f4c9280c..bbe634603 100644 --- a/crates/ra_cargo_watch/src/lib.rs +++ b/crates/ra_cargo_watch/src/lib.rs | |||
@@ -7,7 +7,6 @@ use lsp_types::{ | |||
7 | Diagnostic, Url, WorkDoneProgress, WorkDoneProgressBegin, WorkDoneProgressEnd, | 7 | Diagnostic, Url, WorkDoneProgress, WorkDoneProgressBegin, WorkDoneProgressEnd, |
8 | WorkDoneProgressReport, | 8 | WorkDoneProgressReport, |
9 | }; | 9 | }; |
10 | use parking_lot::RwLock; | ||
11 | use std::{ | 10 | use std::{ |
12 | collections::HashMap, | 11 | collections::HashMap, |
13 | path::PathBuf, | 12 | path::PathBuf, |
@@ -38,7 +37,7 @@ pub struct CheckOptions { | |||
38 | #[derive(Debug)] | 37 | #[derive(Debug)] |
39 | pub struct CheckWatcher { | 38 | pub struct CheckWatcher { |
40 | pub task_recv: Receiver<CheckTask>, | 39 | pub task_recv: Receiver<CheckTask>, |
41 | pub state: Arc<RwLock<CheckState>>, | 40 | pub state: Arc<CheckState>, |
42 | cmd_send: Option<Sender<CheckCommand>>, | 41 | cmd_send: Option<Sender<CheckCommand>>, |
43 | handle: Option<JoinHandle<()>>, | 42 | handle: Option<JoinHandle<()>>, |
44 | } | 43 | } |
@@ -46,7 +45,7 @@ pub struct CheckWatcher { | |||
46 | impl CheckWatcher { | 45 | impl CheckWatcher { |
47 | pub fn new(options: &CheckOptions, workspace_root: PathBuf) -> CheckWatcher { | 46 | pub fn new(options: &CheckOptions, workspace_root: PathBuf) -> CheckWatcher { |
48 | let options = options.clone(); | 47 | let options = options.clone(); |
49 | let state = Arc::new(RwLock::new(CheckState::new())); | 48 | let state = Arc::new(CheckState::new()); |
50 | 49 | ||
51 | let (task_send, task_recv) = unbounded::<CheckTask>(); | 50 | let (task_send, task_recv) = unbounded::<CheckTask>(); |
52 | let (cmd_send, cmd_recv) = unbounded::<CheckCommand>(); | 51 | let (cmd_send, cmd_recv) = unbounded::<CheckCommand>(); |
@@ -59,7 +58,7 @@ impl CheckWatcher { | |||
59 | 58 | ||
60 | /// Returns a CheckWatcher that doesn't actually do anything | 59 | /// Returns a CheckWatcher that doesn't actually do anything |
61 | pub fn dummy() -> CheckWatcher { | 60 | pub fn dummy() -> CheckWatcher { |
62 | let state = Arc::new(RwLock::new(CheckState::new())); | 61 | let state = Arc::new(CheckState::new()); |
63 | CheckWatcher { task_recv: never(), cmd_send: None, handle: None, state } | 62 | CheckWatcher { task_recv: never(), cmd_send: None, handle: None, state } |
64 | } | 63 | } |
65 | 64 | ||
@@ -87,7 +86,7 @@ impl std::ops::Drop for CheckWatcher { | |||
87 | } | 86 | } |
88 | } | 87 | } |
89 | 88 | ||
90 | #[derive(Debug)] | 89 | #[derive(Clone, Debug)] |
91 | pub struct CheckState { | 90 | pub struct CheckState { |
92 | diagnostic_collection: HashMap<Url, Vec<Diagnostic>>, | 91 | diagnostic_collection: HashMap<Url, Vec<Diagnostic>>, |
93 | suggested_fix_collection: HashMap<Url, Vec<SuggestedFix>>, | 92 | suggested_fix_collection: HashMap<Url, Vec<SuggestedFix>>, |