omnidiff 0.2.0

Fast, robust, syntax-aware code diffing using tree-sitter ASTs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
/*  This file is part of the OmniDiff code diffing tool.
 *
 *  Copyright (C) 2026 Marko Ivankovic
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as published
 *  by the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program. If not, see <https://www.gnu.org/licenses/>.
 */
#[cfg(test)]
mod c_cpython_autogenerated_code;
#[cfg(test)]
mod c_ffmpeg_added_typedef_to_enum;
#[cfg(test)]
mod c_freeciv_add_parameter_to_function;
#[cfg(test)]
mod c_htop_remove_function_declaration;
#[cfg(test)]
mod c_linux_small_bugfix;
#[cfg(test)]
mod c_linux_small_change;
#[cfg(test)]
mod c_linux_small_change_struct_to_char;
#[cfg(test)]
mod c_microsoft_terminal_add_function;
#[cfg(test)]
mod c_nginx_add_typedef;
#[cfg(test)]
mod c_postgres_real_logic_change;
#[cfg(test)]
mod cpp_godot_small_bugfix;
#[cfg(test)]
mod cpp_ladybird_refactor_variables_if_changes;
#[cfg(test)]
mod cpp_laydbird_change_function_signature;
#[cfg(test)]
mod cpp_libreoffice_add_const;
#[cfg(test)]
mod cpp_libreoffice_remove_return_value;
#[cfg(test)]
mod cpp_nextcloud_add_test_case;
#[cfg(test)]
mod cpp_ollama_add_function_argument;
#[cfg(test)]
mod cpp_opencv_add_test_case;
#[cfg(test)]
mod cpp_tensorflow_switch_to_primitive_types;
#[cfg(test)]
mod cpp_whitespace_only_change;
#[cfg(test)]
mod csharp_jellyfin_add_function;
#[cfg(test)]
mod csharp_jellyfin_sql_query_fix;
#[cfg(test)]
mod csharp_lidarr_add_function;
#[cfg(test)]
mod csharp_lidarr_call_different_function;
#[cfg(test)]
mod csharp_lidarr_condition_change;
#[cfg(test)]
mod csharp_lidarr_new_feature;
#[cfg(test)]
mod csharp_radarr_add_object_instance;
#[cfg(test)]
mod csharp_sonarr_add_if_block;
#[cfg(test)]
mod csharp_sonarr_add_true_to_function_call;
#[cfg(test)]
mod csharp_sonarr_change_type;
#[cfg(test)]
mod css_add_property;
#[cfg(test)]
mod css_mozilla_firefox_firefox_actual_style_changes;
#[cfg(test)]
mod css_playwright_add_class_selector;
#[cfg(test)]
mod css_shadcn_ui_ui_completely_broken_treesitter_parsing;
#[cfg(test)]
mod css_wordpress_add_comment;
#[cfg(test)]
mod css_wordpress_format_comment_and_fix;
#[cfg(test)]
mod css_wordpress_reformat;
#[cfg(test)]
mod css_wordpress_smalll_change;
#[cfg(test)]
mod css_wordpress_wordpress_autogenerated_file;
#[cfg(test)]
mod css_wordpress_wordpress_change_simple_values_to_vars;
#[cfg(test)]
mod go_caddy_rename_type;
#[cfg(test)]
mod go_gin_add_function;
#[cfg(test)]
mod go_gin_change_import;
#[cfg(test)]
mod go_gin_constant_change;
#[cfg(test)]
mod go_kubernetes_kubernetes_add_unit_test_cases;
#[cfg(test)]
mod go_lazygit_add_to_if_condition;
#[cfg(test)]
mod go_lazygit_switch_to_strings;
#[cfg(test)]
mod go_ollama_ollama_surround_block_with_if_and_function_call;
#[cfg(test)]
mod go_prometheus_single_comment_change;
#[cfg(test)]
mod go_user_slices_library;
#[cfg(test)]
mod html_apache_echarts_actual_structure_change;
#[cfg(test)]
mod html_fatedier_add_attribute;
#[cfg(test)]
mod html_firefox_update_src;
#[cfg(test)]
mod html_gohugoio_hugo_enclose_table_with_div_and_add_thead_tbody;
#[cfg(test)]
mod html_gorhill_add_tag;
#[cfg(test)]
mod html_hugo_tag_to_selfclosing_tag;
#[cfg(test)]
mod html_ladybird_delete_attribute;
#[cfg(test)]
mod html_mermaid_update_link;
#[cfg(test)]
mod html_mozilla_firefox_firefox_remove_li_around_button;
#[cfg(test)]
mod html_twbs_bootstrap_add_the_same_attribute_in_many_places;
#[cfg(test)]
mod java_genymobile_scrcpy_change_some_android_version_constant;
#[cfg(test)]
mod java_genymobile_scrcpy_refactor_for_loop_in_a_function;
#[cfg(test)]
mod java_genymobile_scrcpy_switch_from_three_exceptions_to_one;
#[cfg(test)]
mod java_nextcloud_android_add_if_branch_with_reused_return;
#[cfg(test)]
mod java_nextcloud_android_add_two_function_calls;
#[cfg(test)]
mod java_protobuf_add_two_annotations;
#[cfg(test)]
mod java_protocolbuffers_protobuf_add_a_method;
#[cfg(test)]
mod java_protocolbuffers_protobuf_add_import_and_update_field_access;
#[cfg(test)]
mod java_scrcpy_public_to_protected;
#[cfg(test)]
mod java_scrcpy_remove_or_expression;
#[cfg(test)]
mod javascript_microsoft_typescript_another_test_case_marked_with_strict;
#[cfg(test)]
mod javascript_microsoft_typescript_broken_js_remove_string_fragment;
#[cfg(test)]
mod javascript_microsoft_typescript_test_data_pretending_to_be_code_maybe_broken_parsing;
#[cfg(test)]
mod javascript_mozilla_firefox_add_comment;
#[cfg(test)]
mod javascript_twbs_bootstrap_comment_version_update;
#[cfg(test)]
mod javascript_typescript_add_strict_3;
#[cfg(test)]
mod javascript_typescript_add_use_strict;
#[cfg(test)]
mod javascript_typescript_interesting_small_edit_refactor;
#[cfg(test)]
mod javascript_typescript_use_strict_2;
#[cfg(test)]
mod javascript_typescript_very_interesting_brokn_code;
#[cfg(test)]
mod json_apache_string_change_version;
#[cfg(test)]
mod json_excalidraw_excalidraw_change_translations_mostly_add;
#[cfg(test)]
mod json_gorhill_ublock_add_5_pairs;
#[cfg(test)]
mod json_langflow_update_single_string;
#[cfg(test)]
mod json_mastodon_add_translation;
#[cfg(test)]
mod json_nextcloud_server_deleted_pair;
#[cfg(test)]
mod json_nextcloud_server_remove_many_and_move_one;
#[cfg(test)]
mod json_radarr_radarr_rename_string_key;
#[cfg(test)]
mod json_shadcn_ui_ui_react_code_in_string_constant;
#[cfg(test)]
mod json_shadcn_ui_ui_string_value_update_string_is_code;
#[cfg(test)]
mod kotlin_nextcloud_a_few_small_removals;
#[cfg(test)]
mod kotlin_nextcloud_android_add_a_feature;
#[cfg(test)]
mod kotlin_nextcloud_android_dot_to_question_mark_dot;
#[cfg(test)]
mod kotlin_nextcloud_android_extract_argument_into_variable;
#[cfg(test)]
mod kotlin_nextcloud_android_move_from_one_mocking_library_to_other;
#[cfg(test)]
mod kotlin_nextcloud_change_function_fingerprint;
#[cfg(test)]
mod kotlin_nextcloud_remove_function;
#[cfg(test)]
mod kotlin_nextcloud_whitespace_only_change;
#[cfg(test)]
mod kotlin_remove_function;
#[cfg(test)]
mod kotlin_small_api_change;
#[cfg(test)]
mod lua_awesome_only_comment_change;
#[cfg(test)]
mod lua_awesomewm_awesome_align_to_halign;
#[cfg(test)]
mod lua_awesomewm_awesome_change_doccomments;
#[cfg(test)]
mod lua_awesomewm_awesome_comment_changes_and_additions;
#[cfg(test)]
mod lua_neovim_neovim_add_if_around_one_line;
#[cfg(test)]
mod lua_neovim_neovim_add_new_logic;
#[cfg(test)]
mod lua_neovim_neovim_constant_changes;
#[cfg(test)]
mod lua_neovim_neovim_if_flips_two_branches;
#[cfg(test)]
mod lua_neovim_neovim_logic_change_with_some_code_re_use;
#[cfg(test)]
mod lua_neovim_one_added_line;
#[cfg(test)]
mod php_nextcloud_change_doccomment;
#[cfg(test)]
mod php_nextcloud_server_whitespace_and_added_declaration;
#[cfg(test)]
mod php_wordpress_wordpress_add_null_to_return;
#[cfg(test)]
mod php_wordpress_wordpress_add_rtc_check;
#[cfg(test)]
mod php_wordpress_wordpress_add_some_checks;
#[cfg(test)]
mod php_wordpress_wordpress_update_doccomment;
#[cfg(test)]
mod php_wordpress_wordpress_version_update;
#[cfg(test)]
mod php_wordpress_wordpress_version_update_2;
#[cfg(test)]
mod php_wordpress_wordpress_version_update_3;
#[cfg(test)]
mod php_wordpress_wordpress_whitespace_only_change;
#[cfg(test)]
mod python_ansible_ansible_field_rename;
#[cfg(test)]
mod python_ansible_ansible_ridiculously_long_yaml_in_string_constant_and_actual_code_changes;
#[cfg(test)]
mod python_django_django_update_unit_tests_actual_logic_change;
#[cfg(test)]
mod python_langflow_ai_langflow_actual_change_of_logic;
#[cfg(test)]
mod python_openhands_openhands_change_string_constant;
#[cfg(test)]
mod python_paddlepaddle_paddleocr_formatting_only_change;
#[cfg(test)]
mod python_pandas_dev_pandas_doccoment_changes_only;
#[cfg(test)]
mod python_pytorch_pytorch_add_param_to_many_places_and_update_one;
#[cfg(test)]
mod python_thefuck_multiline_string_change;
#[cfg(test)]
mod python_ytdl_add_import_and_function_call;
#[cfg(test)]
mod ruby_homebrew_add_or_expression;
#[cfg(test)]
mod ruby_homebrew_brew_actual_logic_change;
#[cfg(test)]
mod ruby_homebrew_brew_change_heredoc_to_string;
#[cfg(test)]
mod ruby_homebrew_brew_decent_amount_of_new_code_and_some_changes;
#[cfg(test)]
mod ruby_homebrew_brew_enclose_block_in_rescue;
#[cfg(test)]
mod ruby_homebrew_brew_function_callsite_argument_change;
#[cfg(test)]
mod ruby_homebrew_brew_real_small_change;
#[cfg(test)]
mod ruby_junegunn_fzf_add_test_case;
#[cfg(test)]
mod ruby_junegunn_fzf_add_test_case_2;
#[cfg(test)]
mod ruby_mastodon_mastodon_use_context_and_new_test_case;
#[cfg(test)]
mod rust_rust_lang_rust_add_key_to_function_arguments_and_call_sites;
#[cfg(test)]
mod rust_rustdesk_add_item;
#[cfg(test)]
mod rust_rustdesk_add_one_slice_element;
#[cfg(test)]
mod rust_rustdesk_rustdesk_actual_logic_change_in_io_loop_medium_sized_file;
#[cfg(test)]
mod rust_rustdesk_rustdesk_add_two_values_to_slice;
#[cfg(test)]
mod rust_rustdesk_rustdesk_large_file_40k_normal_feature_work;
#[cfg(test)]
mod rust_rustdesk_rustdesk_string_constant_change;
#[cfg(test)]
mod rust_vercel_nextjs_move_from_one_struct_to_another_and_add_some_code;
#[cfg(test)]
mod rust_vercel_nextjs_refactoring_would_require_mulitmap_mapping;
#[cfg(test)]
mod rust_zed_industries_zed_add_argument;
#[cfg(test)]
mod shellscript_ansible_ansible_add_variable_and_string_expansion;
#[cfg(test)]
mod shellscript_ansible_ansible_simple_deletion;
#[cfg(test)]
mod shellscript_genymobile_scrcpy_add_two_flags;
#[cfg(test)]
mod shellscript_langchain_ai_langchain_some_interesting_raw_string_to_string_content;
#[cfg(test)]
mod shellscript_nextcloud_server_change_invocation_string;
#[cfg(test)]
mod shellscript_nvm_sh_nvm_upgrade_version_string;
#[cfg(test)]
mod shellscript_pi_hole_pi_hole_sql_code_in_string_constant;
#[cfg(test)]
mod shellscript_pytorch_pytorch_change_invocation_string;
#[cfg(test)]
mod shellscript_scikit_learn_scikit_learn_string_to_regex;
#[cfg(test)]
mod shellscript_torvalds_linux_double_equals_to_equals;
#[cfg(test)]
mod swift_nextcloud_ios_actual_control_flow_change;
#[cfg(test)]
mod swift_nextcloud_ios_actual_logic_added;
#[cfg(test)]
mod swift_nextcloud_ios_add_4_functions;
#[cfg(test)]
mod swift_nextcloud_ios_call_different_function;
#[cfg(test)]
mod swift_nextcloud_ios_move_function_and_refactor_logic;
#[cfg(test)]
mod swift_nextcloud_ios_refactor_and_change;
#[cfg(test)]
mod swift_swiftlang_swift_actual_logic_change;
#[cfg(test)]
mod swift_swiftlang_swift_comment_change;
#[cfg(test)]
mod swift_swiftlang_swift_comment_change_2;
#[cfg(test)]
mod swift_swiftlang_swift_enable_checks_remove_todo_comment;
#[cfg(test)]
mod tsx_apache_superset_add_test_case;
#[cfg(test)]
mod tsx_apache_superset_error_handling_change;
#[cfg(test)]
mod tsx_excalidraw_excalidraw_huge_file_with_real_logic_change;
#[cfg(test)]
mod tsx_excalidraw_excalidraw_import_path_change;
#[cfg(test)]
mod tsx_excalidraw_excalidraw_move_from_one_struct_to_other;
#[cfg(test)]
mod tsx_langflow_ai_langflow_move_function_around_update_string_constant;
#[cfg(test)]
mod tsx_material_remove_import;
#[cfg(test)]
mod tsx_mui_material_ui_move_colour_to_a_new_attribute;
#[cfg(test)]
mod tsx_shadcn_ui_ui_add_attribute;
#[cfg(test)]
mod tsx_shadcn_ui_ui_real_small_change;
#[cfg(test)]
mod typescript_excalidraw_excalidraw_add_function;
#[cfg(test)]
mod typescript_excalidraw_excalidraw_add_values_to_lists;
#[cfg(test)]
mod typescript_microsoft_playwright_add_two_test_cases;
#[cfg(test)]
mod typescript_microsoft_typescript_add_dot_js_to_import_paths;
#[cfg(test)]
mod typescript_microsoft_typescript_add_target_comment;
#[cfg(test)]
mod typescript_microsoft_typescript_comment_change;
#[cfg(test)]
mod typescript_n8n_io_n8n_remove_and_add_imports;
#[cfg(test)]
mod typescript_typescript_add_target_comment;
#[cfg(test)]
mod typescript_typescript_add_target_comment_2;
#[cfg(test)]
mod typescript_typescript_add_target_comment_3;
#[cfg(test)]
mod vimscript_junegunn_fzf_condition_canges;
#[cfg(test)]
mod vimscript_neovim_neovim_add_a_few_lines;
#[cfg(test)]
mod vimscript_neovim_neovim_add_a_few_lines_one_after_the_other;
#[cfg(test)]
mod vimscript_neovim_neovim_add_line_comment;
#[cfg(test)]
mod vimscript_neovim_neovim_add_test_case_plus_edit_existing_one;
#[cfg(test)]
mod vimscript_neovim_neovim_add_two_functions_and_modify_a_few_lines;
#[cfg(test)]
mod vimscript_neovim_neovim_awful_test_case_bunch_of_hex_colours_more_data_than_code;
#[cfg(test)]
mod vimscript_neovim_neovim_i_have_no_idea_what_this_diff_does;
#[cfg(test)]
mod vimscript_neovim_neovim_improved_asserts;
#[cfg(test)]
mod vimscript_neovim_neovim_test_debian_package_parsing_awful_string_matching;
#[cfg(test)]
mod xml_microsoft_terminal_multiline_string_constant_change;
#[cfg(test)]
mod xml_mozilla_firefox_firefox_add_a_few_attributes;
#[cfg(test)]
mod xml_mozilla_firefox_firefox_add_a_few_translations_and_a_few_attributes;
#[cfg(test)]
mod xml_nextcloud_android_add_few_translations;
#[cfg(test)]
mod xml_nextcloud_android_delete_element;
#[cfg(test)]
mod xml_nextcloud_android_delete_element_2;
#[cfg(test)]
mod xml_odoo_odoo_add_attribute;
#[cfg(test)]
mod xml_odoo_odoo_add_button_roles;
#[cfg(test)]
mod xml_odoo_odoo_add_two_attributes;
#[cfg(test)]
mod xml_odoo_odoo_change_value;
#[cfg(test)]
mod yaml_ansible_ansible_add_two_sequence_items;
#[cfg(test)]
mod yaml_ansible_ansible_double_quote_scalar_change_possible_treesitter_weakness;
#[cfg(test)]
mod yaml_axios_axios_update_string_value;
#[cfg(test)]
mod yaml_junegunn_fzf_version_upgrade;
#[cfg(test)]
mod yaml_mastodon_mastodon_add_block_pair_translation;
#[cfg(test)]
mod yaml_mastodon_remove_one_pair;
#[cfg(test)]
mod yaml_mozilla_pdf_single_value_update;
#[cfg(test)]
mod yaml_n8n_io_n8n_add_performance_check_to_ci_config;
#[cfg(test)]
mod yaml_twbs_bootstrap_remove_v_semicolon_from_version_numbers;
#[cfg(test)]
mod yaml_twbs_bootstrap_version_pin_with_comment;