From b0f7e72c49141df0ad95e3fcb561ee6a4d86b537 Mon Sep 17 00:00:00 2001 From: Bernardo Date: Tue, 15 Jan 2019 17:45:56 +0100 Subject: use notify with fix --- crates/ra_lsp_server/src/main_loop.rs | 2 +- crates/ra_vfs/Cargo.toml | 3 ++- crates/ra_vfs/src/watcher.rs | 15 ++++++--------- crates/ra_vfs/tests/vfs.rs | 4 ++-- 4 files changed, 11 insertions(+), 13 deletions(-) (limited to 'crates') 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::{ }; use lsp_types::NumberOrString; use ra_ide_api::{Canceled, FileId, LibraryData}; -use ra_vfs::{VfsTask, WatcherChange}; +use ra_vfs::VfsTask; use rustc_hash::FxHashSet; use serde::{de::DeserializeOwned, Serialize}; 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" rustc-hash = "1.0" crossbeam-channel = "0.3.5" log = "0.4.6" -notify = "4" +# until https://github.com/passcod/notify/issues/169 is fixed +notify = { git = "https://github.com/vemoo/notify/", branch = "v4-legacy" } drop_bomb = "0.1.0" 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 { pub fn shutdown(mut self) -> thread::Result<()> { self.bomb.defuse(); drop(self.watcher); - // TODO this doesn't terminate because of a buf in `notify` - // uncomment when https://github.com/passcod/notify/pull/170 is released - // let res = self.thread.join(); - // match &res { - // Ok(()) => log::info!("... Watcher terminated with ok"), - // Err(_) => log::error!("... Watcher terminated with err"), - // } - // res - Ok(()) + let res = self.thread.join(); + match &res { + Ok(()) => log::info!("... Watcher terminated with ok"), + Err(_) => log::error!("... Watcher terminated with err"), + } + res } } 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 @@ use std::{collections::HashSet, fs}; -use flexi_logger::Logger; +// use flexi_logger::Logger; use ra_vfs::{Vfs, VfsChange}; use tempfile::tempdir; @@ -13,7 +13,7 @@ fn process_tasks(vfs: &mut Vfs, num_tasks: u32) { #[test] fn test_vfs_works() -> std::io::Result<()> { - Logger::with_str("debug").start().unwrap(); + // Logger::with_str("debug").start().unwrap(); let files = [ ("a/foo.rs", "hello"), -- cgit v1.2.3