diff options
author | Bernardo <[email protected]> | 2019-01-15 16:45:56 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-26 08:46:27 +0000 |
commit | b0f7e72c49141df0ad95e3fcb561ee6a4d86b537 (patch) | |
tree | ae4c4aee243d59046dd9cadb072fef8f48ea7167 /crates | |
parent | 5f31d495bdc8639a826f60c6f42d12bb89be9f1a (diff) |
use notify with fix
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop.rs | 2 | ||||
-rw-r--r-- | crates/ra_vfs/Cargo.toml | 3 | ||||
-rw-r--r-- | crates/ra_vfs/src/watcher.rs | 15 | ||||
-rw-r--r-- | crates/ra_vfs/tests/vfs.rs | 4 |
4 files changed, 11 insertions, 13 deletions
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 4f984ebc7..ddd20a41f 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs | |||
@@ -11,7 +11,7 @@ use gen_lsp_server::{ | |||
11 | }; | 11 | }; |
12 | use lsp_types::NumberOrString; | 12 | use lsp_types::NumberOrString; |
13 | use ra_ide_api::{Canceled, FileId, LibraryData}; | 13 | use ra_ide_api::{Canceled, FileId, LibraryData}; |
14 | use ra_vfs::{VfsTask, WatcherChange}; | 14 | use ra_vfs::VfsTask; |
15 | use rustc_hash::FxHashSet; | 15 | use rustc_hash::FxHashSet; |
16 | use serde::{de::DeserializeOwned, Serialize}; | 16 | use serde::{de::DeserializeOwned, Serialize}; |
17 | use threadpool::ThreadPool; | 17 | use threadpool::ThreadPool; |
diff --git a/crates/ra_vfs/Cargo.toml b/crates/ra_vfs/Cargo.toml index b703cbd9f..1a21557bf 100644 --- a/crates/ra_vfs/Cargo.toml +++ b/crates/ra_vfs/Cargo.toml | |||
@@ -10,7 +10,8 @@ relative-path = "0.4.0" | |||
10 | rustc-hash = "1.0" | 10 | rustc-hash = "1.0" |
11 | crossbeam-channel = "0.3.5" | 11 | crossbeam-channel = "0.3.5" |
12 | log = "0.4.6" | 12 | log = "0.4.6" |
13 | notify = "4" | 13 | # until https://github.com/passcod/notify/issues/169 is fixed |
14 | notify = { git = "https://github.com/vemoo/notify/", branch = "v4-legacy" } | ||
14 | drop_bomb = "0.1.0" | 15 | drop_bomb = "0.1.0" |
15 | 16 | ||
16 | thread_worker = { path = "../thread_worker" } | 17 | thread_worker = { path = "../thread_worker" } |
diff --git a/crates/ra_vfs/src/watcher.rs b/crates/ra_vfs/src/watcher.rs index 190a9f924..3bd0e7da2 100644 --- a/crates/ra_vfs/src/watcher.rs +++ b/crates/ra_vfs/src/watcher.rs | |||
@@ -86,14 +86,11 @@ impl Watcher { | |||
86 | pub fn shutdown(mut self) -> thread::Result<()> { | 86 | pub fn shutdown(mut self) -> thread::Result<()> { |
87 | self.bomb.defuse(); | 87 | self.bomb.defuse(); |
88 | drop(self.watcher); | 88 | drop(self.watcher); |
89 | // TODO this doesn't terminate because of a buf in `notify` | 89 | let res = self.thread.join(); |
90 | // uncomment when https://github.com/passcod/notify/pull/170 is released | 90 | match &res { |
91 | // let res = self.thread.join(); | 91 | Ok(()) => log::info!("... Watcher terminated with ok"), |
92 | // match &res { | 92 | Err(_) => log::error!("... Watcher terminated with err"), |
93 | // Ok(()) => log::info!("... Watcher terminated with ok"), | 93 | } |
94 | // Err(_) => log::error!("... Watcher terminated with err"), | 94 | res |
95 | // } | ||
96 | // res | ||
97 | Ok(()) | ||
98 | } | 95 | } |
99 | } | 96 | } |
diff --git a/crates/ra_vfs/tests/vfs.rs b/crates/ra_vfs/tests/vfs.rs index 9cde2bed7..87fb5a092 100644 --- a/crates/ra_vfs/tests/vfs.rs +++ b/crates/ra_vfs/tests/vfs.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use std::{collections::HashSet, fs}; | 1 | use std::{collections::HashSet, fs}; |
2 | 2 | ||
3 | use flexi_logger::Logger; | 3 | // use flexi_logger::Logger; |
4 | use ra_vfs::{Vfs, VfsChange}; | 4 | use ra_vfs::{Vfs, VfsChange}; |
5 | use tempfile::tempdir; | 5 | use tempfile::tempdir; |
6 | 6 | ||
@@ -13,7 +13,7 @@ fn process_tasks(vfs: &mut Vfs, num_tasks: u32) { | |||
13 | 13 | ||
14 | #[test] | 14 | #[test] |
15 | fn test_vfs_works() -> std::io::Result<()> { | 15 | fn test_vfs_works() -> std::io::Result<()> { |
16 | Logger::with_str("debug").start().unwrap(); | 16 | // Logger::with_str("debug").start().unwrap(); |
17 | 17 | ||
18 | let files = [ | 18 | let files = [ |
19 | ("a/foo.rs", "hello"), | 19 | ("a/foo.rs", "hello"), |