(path: &str, old: &str, new: &str)
| 727 | } |
| 728 | |
| 729 | fn generate_diff(path: &str, old: &str, new: &str) -> String { |
| 730 | let old_lines: Vec<&str> = old.lines().collect(); |
| 731 | let new_lines: Vec<&str> = new.lines().collect(); |
| 732 | |
| 733 | let mut diff = format!("--- a/{}\n+++ b/{}\n", path, path); |
| 734 | |
| 735 | let old_count = old_lines.len(); |
| 736 | let new_count = new_lines.len(); |
| 737 | |
| 738 | diff.push_str(&format!( |
| 739 | "@@ -1,{} +1,{} @@\n", |
| 740 | old_count.max(1), |
| 741 | new_count.max(1) |
| 742 | )); |
| 743 | |
| 744 | for line in &old_lines { |
| 745 | diff.push_str(&format!("-{}\n", line)); |
| 746 | } |
| 747 | for line in &new_lines { |
| 748 | diff.push_str(&format!("+{}\n", line)); |
| 749 | } |
| 750 | |
| 751 | diff |
| 752 | } |
| 753 | |
| 754 | async fn collect_lsp_diagnostics_for_targets( |
| 755 | base_path: &Path, |
no outgoing calls
no test coverage detected