(file_path: &str, ast_edit: &ASTEdit)
| 43 | } |
| 44 | |
| 45 | pub fn ast_to_diff(file_path: &str, ast_edit: &ASTEdit) -> String { |
| 46 | format!( |
| 47 | "--- {file}\n+++ {file}\n@@ AST_EDIT @@\n# symbol: {symbol}\n# transformation: {tx:?}\n", |
| 48 | file = file_path, |
| 49 | symbol = ast_edit.target_symbol, |
| 50 | tx = ast_edit.transformation |
| 51 | ) |
| 52 | } |
| 53 | |
| 54 | pub fn validate_patch(file_path: &str, patch: &CodePatch, existing_code: &str) -> Result<()> { |
| 55 | let updated = match &patch.representation { |
nothing calls this directly
no outgoing calls
no test coverage detected