Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Properly ignore missing/empty runnables config
Kirill Bulatovc54d6aff6c8d
diff --git a/crates/runnable/src/static_source.rs b/crates/runnable/src/static_source.rsindex 9edd7a1afe7..0d249918c72 100644--- a/crates/runnable/src/static_source.rs+++ b/crates/runnable/src/static_source.rs@@ -79,17 +79,20 @@ impl<T: for<'a> Deserialize<'a> + PartialEq + 'static> TrackedFile<T> {) -> Model<Self> {cx.new_model(move |cx| {cx.spawn(|tracked_file, mut cx| async move {- while let Some(new_contents) = tracker.next().await.filter(|s| !s.is_empty()) {- let Some(new_contents) = serde_json_lenient::from_str(&new_contents).log_err()- else {- continue;- };- tracked_file.update(&mut cx, |tracked_file: &mut TrackedFile<T>, cx| {- if tracked_file.parsed_contents != new_contents {- tracked_file.parsed_contents = new_contents;- cx.notify();+ while let Some(new_contents) = tracker.next().await {+ if !new_contents.trim().is_empty() {+ let Some(new_contents) =+ serde_json_lenient::from_str(&new_contents).log_err()+ else {+ continue;};- })?;+ tracked_file.update(&mut cx, |tracked_file: &mut TrackedFile<T>, cx| {+ if tracked_file.parsed_contents != new_contents {+ tracked_file.parsed_contents = new_contents;+ cx.notify();+ };+ })?;+ }}anyhow::Ok(())})