Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
ep: Diagnostics as `retrieval_chunks` for sweep ep (#47441)
versecafe06b5ec466456
diff --git a/crates/edit_prediction/src/sweep_ai.rs b/crates/edit_prediction/src/sweep_ai.rsindex cab57565f8c..cb1f89c1877 100644--- a/crates/edit_prediction/src/sweep_ai.rs+++ b/crates/edit_prediction/src/sweep_ai.rs@@ -95,7 +95,7 @@ impl SweepAi {write_event(event.as_ref(), &mut recent_changes).unwrap();}- let mut file_chunks = recent_buffer_snapshots+ let file_chunks = recent_buffer_snapshots.into_iter().map(|snapshot| {let end_point = Point::new(30, 0).min(snapshot.max_point());@@ -120,7 +120,7 @@ impl SweepAi {}).collect::<Vec<_>>();- let retrieval_chunks = inputs+ let mut retrieval_chunks: Vec<FileChunk> = inputs.related_files.iter().flat_map(|related_file| {@@ -155,17 +155,19 @@ impl SweepAi {writeln!(&mut diagnostic_content,- "{} at line {}: {}",- severity,+ "{}:{}:{}: {}: {}",+ full_path.display(),start_point.row + 1,+ start_point.column + 1,+ severity,entry.diagnostic.message)?;}if !diagnostic_content.is_empty() {- file_chunks.push(FileChunk {- file_path: format!("Diagnostics for {}", full_path.display()),- start_line: 0,+ retrieval_chunks.push(FileChunk {+ file_path: "diagnostics".to_string(),+ start_line: 1,end_line: diagnostic_count,content: diagnostic_content,timestamp: None,