Added new Diff on both DiffBuilders for more detailed DiffModel.#83
Added new Diff on both DiffBuilders for more detailed DiffModel.#83driekus77 wants to merge 1 commit intommanela:masterfrom
Conversation
| { | ||
| public class DiffPaneModel | ||
| { | ||
| public List<DiffPiece> Chunks => Lines; |
There was a problem hiding this comment.
Because when Line chunker isn't used as first the current name "Lines" doesn't represent its contents.
But its just a small alias np for me to delete it.
There was a problem hiding this comment.
Sounds fine, can you put summary comments on both maybe to clear up any confusion?
| return model; | ||
| } | ||
|
|
||
| public static DiffPaneModel Diff( |
There was a problem hiding this comment.
Instread of having this logic close to twice, could we instread just share the BuildDiffPieces logic that SideBySide uses, extract it to a common place? Then let inline do one last step to flatten it?
There was a problem hiding this comment.
Yes you are probably right. Was trying to solve it twice now.
| public static SideBySideDiffModel Diff( | ||
| IDiffer differ, | ||
| string oldText, string newText, | ||
| List<IChunker> detailsPack, |
There was a problem hiding this comment.
I like the idea to give an array, but detailsPack name is too general. maybe called it chunkers or something
| return model; | ||
| } | ||
|
|
||
| public static SideBySideDiffModel Diff( |
There was a problem hiding this comment.
Couldn't we update the other methods in this file to use the new more general method here?
There was a problem hiding this comment.
Good point If unit tests will still pass I'll look into this.
|
Hi guys, i am wondering why we dont merge this PR? It is very useful for inline diff to have subpieces. |
|
There are unresolved comments I believe. |
See Issue #29
Added on both InlineDiffBuilder and SideBySideDiffBuilder possibility to add more details by providing a detailsPack of IChunker(s).
The InlineDiffBuilder on lowest level, is still missing the old / before char info. Didn't know where to put it: After or Under(SubPiece) the new / after char. Advice / help is welcome!
In order to not introduce any breaking changes in the API I introduced new Diff overload methods. These method(s) distinguish themselves by a detailsPack (Name oke?) that include the IChunkers to use. If null then default all 3 chunkers are used: Lines => Words => Characters.
Review comments are welcome!
Thanks for this great lib!