Wilfred Hughes
09a80150df
Fix adding/removing whole files
...
The 'remove unaligned lines at beginning of hunk' logic meant we just
discarded the whole hunk.
This breaks alignment again (previously fixed in 3ebbf268fd ), but that
should be fixed properly in the padding logic.
2021-08-08 23:15:23 +07:00
Wilfred Hughes
f56ca49747
Pass LineGroup directly to aligned_lines
2021-08-08 20:45:15 +07:00
Wilfred Hughes
2a905e28bc
Allow storing opposite position on unchanged comment parts
2021-08-08 00:04:05 +07:00
Wilfred Hughes
bbb0f2fcba
Store opposite position on unchanged matched positions
2021-08-07 16:14:16 +07:00
Wilfred Hughes
3a1e34160f
Fix typo
2021-08-07 13:28:55 +07:00
Wilfred Hughes
a7063c97c7
Allow copying and/or cloning of match information
2021-08-04 23:48:45 +07:00
Wilfred Hughes
cbea00e6a6
Add todo
2021-08-04 23:25:27 +07:00
Wilfred Hughes
e67732bab9
Improve contiguous novel logic
...
Inspect the previous syntactic node, then get the atom position, open
delimiter position or close delimiter position depending on the
context.
2021-07-31 16:54:14 +07:00
Wilfred Hughes
017c9fb6d8
Define a num_ancestors helper
2021-07-31 16:38:15 +07:00
Wilfred Hughes
e4feb734d4
Formatting
2021-07-31 12:07:46 +07:00
Wilfred Hughes
8de611ae0a
Also store the previous syntax node in SyntaxInfo
2021-07-31 12:03:56 +07:00
Wilfred Hughes
f8a8465f16
Fix some clippy lints from the pedantic category
2021-07-31 01:14:11 +07:00
Wilfred Hughes
ad9f72d6b4
Run latest clippy on all targets and fix issues
2021-07-31 00:59:21 +07:00
Wilfred Hughes
76c7f35d56
Add module doc comments
2021-07-30 01:23:38 +07:00
Wilfred Hughes
e6693d2204
Add TODO
2021-07-25 13:56:00 +07:00
Wilfred Hughes
f8b6b8ae13
Define a SyntaxInfo::new helper
2021-07-25 13:52:30 +07:00
Wilfred Hughes
171236e2d5
Avoid recompiling another regex
2021-07-25 13:03:15 +07:00
Wilfred Hughes
9c37d854d1
Avoid .unwrap() when printing positions
2021-07-25 13:00:46 +07:00
Wilfred Hughes
04214ef1ef
Ignore indentation changes on multiline comments
2021-07-25 12:27:24 +07:00
Wilfred Hughes
280a5ffe9e
Add alignment todo
2021-07-25 10:41:45 +07:00
Wilfred Hughes
64cc9ce973
Remove completed todo
2021-07-25 09:53:01 +07:00
Wilfred Hughes
3ebbf268fd
Improve alignment when LHS and RHS have different numbers of lines
2021-07-24 18:01:12 +07:00
Wilfred Hughes
3a26616fac
Remove commented-out code
2021-07-24 16:58:51 +07:00
Wilfred Hughes
f79c77d421
Prefer u64 for num_descendants
2021-07-24 16:06:46 +07:00
Wilfred Hughes
b3f98e9639
LineNumber only has one field, so use a tuple struct
2021-07-24 16:04:25 +07:00
Wilfred Hughes
61446c916a
Prefer marking large subtrees as novel rather than largely novel
...
This solves the "replace function A with completely different function
B" problem, even if they start with the same function keyword.
2021-07-21 01:05:01 +07:00
Wilfred Hughes
2d9efe15a0
Fix another crash on empty files
...
Git history with file additions/removals should now work.
2021-07-20 00:22:01 +07:00
Wilfred Hughes
841dba8789
Improve debug display of position on Syntax values
2021-07-18 22:27:17 +07:00
Wilfred Hughes
b77adf6c46
Prefer using the .info() helper
2021-07-18 00:00:02 +07:00
Wilfred Hughes
3bbfe83cb0
Rename id to unique_id
2021-07-17 23:59:56 +07:00
Wilfred Hughes
2c8577811d
More TODOs
2021-07-17 19:02:48 +07:00
Wilfred Hughes
3a37453c1a
Add TODO
2021-07-17 18:46:07 +07:00
Wilfred Hughes
cdc70dd784
Add ReplaceComment edge and display a word diff between the comments
2021-07-17 13:55:41 +07:00
Wilfred Hughes
1bdd68029c
Allow a single change to return multiple match positions
2021-07-17 12:26:19 +07:00
Wilfred Hughes
8f17f86fce
Define a heper function to create MatchedPos
2021-07-16 00:21:40 +07:00
Wilfred Hughes
ae4f404d1a
Fix an issue where atoms were marked as comments
...
Currently atoms and comments are not printed differently, so this bug
was not user-visible.
2021-07-15 00:22:58 +07:00
Wilfred Hughes
97816fb5a3
Remove dead code tracking moves
2021-07-14 22:32:56 +07:00
Wilfred Hughes
f153735011
Clippy fixes
2021-07-13 23:37:18 +07:00
Wilfred Hughes
3250fc6f84
Prefer novel nodes that follow another novel node
2021-07-13 22:19:21 +07:00
Wilfred Hughes
ba645cfe2a
Track whether nodes had a previous novel line
2021-07-13 22:16:57 +07:00
Wilfred Hughes
fbb2dffd4a
Store an ID on Syntax values and use it for vertex equality
2021-07-13 21:49:40 +07:00
Wilfred Hughes
b2d9035774
Consider nesting depth when comparing nodes
2021-07-10 17:42:02 +07:00
Wilfred Hughes
ab07c6b171
Factor out a single init_info helper
2021-07-10 17:28:10 +07:00
Wilfred Hughes
19f090c22b
Define a .info() helper function on Syntax values
2021-07-10 17:13:23 +07:00
Wilfred Hughes
ef4a39ef4f
Store num_ancestors in syntax tree info too
2021-07-10 16:51:13 +07:00
Wilfred Hughes
63804ab09f
Factor out fields that are common to List and Atom
2021-07-10 16:08:38 +07:00
Wilfred Hughes
e5bcf62adb
Use atom creator helper in tests
2021-07-10 15:06:59 +07:00
Wilfred Hughes
55d3f6d9e4
Define separate helpers for new atoms and new comments
2021-07-10 13:42:40 +07:00
Wilfred Hughes
48ed9d71ff
Tweak method name
2021-07-10 13:35:13 +07:00
Wilfred Hughes
3dd0521a04
Track if atoms are comment, but nothing else
2021-07-10 13:26:54 +07:00