linux watcher (#12615)

fixes https://github.com/zed-industries/zed/issues/12297
fixes https://github.com/zed-industries/zed/issues/11345

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
This commit is contained in:
Conrad Irwin 2024-06-03 22:17:10 -06:00 committed by GitHub
parent 3cd6719b30
commit edd613062a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 186 additions and 125 deletions

View file

@ -881,7 +881,7 @@ fn load_user_themes_in_background(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {
fn watch_themes(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {
use std::time::Duration;
cx.spawn(|cx| async move {
let mut events = fs
let (mut events, _) = fs
.watch(&paths::THEMES_DIR.clone(), Duration::from_millis(100))
.await;
@ -920,7 +920,7 @@ fn watch_languages(fs: Arc<dyn fs::Fs>, languages: Arc<LanguageRegistry>, cx: &m
};
cx.spawn(|_| async move {
let mut events = fs.watch(path.as_path(), Duration::from_millis(100)).await;
let (mut events, _) = fs.watch(path.as_path(), Duration::from_millis(100)).await;
while let Some(event) = events.next().await {
let has_language_file = event.iter().any(|path| {
path.extension()
@ -954,7 +954,7 @@ fn watch_file_types(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {
};
cx.spawn(|cx| async move {
let mut events = fs.watch(path.as_path(), Duration::from_millis(100)).await;
let (mut events, _) = fs.watch(path.as_path(), Duration::from_millis(100)).await;
while (events.next().await).is_some() {
cx.update(|cx| {
FileIcons::update_global(cx, |file_types, _cx| {