In the 3.3 release, we are planning on working on some of the outstanding defects that have accumulated for the Compare component. Some of the areas we plan on looking at are:
- Asynchronous loading and update of compare editors
- Improving the save life-cycling
- Improving difference and change Navigation
- Use of text buffers when comparing local content
- Upgrade to use the new Commands/Key bindings framework
- Switch to using the History view for local history operations (Compare/Replace/Restore)
The following sections outline some thoughts on each of these areas.
Saving properly in the Compare framework has always been a bit of a black art. The reason for this is the layered nature of the Compare framework. For a local file, the layers are:
- The file (instance of IFile)
- The ResourceNode (instance of IEditableContent)
- The TextMergeViewer
Assume you have an merge viewer open and edit the left side. A save is triggered by a Save operation or selecting another element to edit. What happens in this case is the following:
- save is called on ContentMergeViewer
- save obtains the content from the left side Document in the content merge viewer (problem: content is assumed to be a byte array).
- content from document is passed to the viewer content provider (instance of MergeViewerContentProvider)
- the content provider calls saveContent on the left typed element of the compare input if the compare input is an IEditableContent).
- the ResourceNode updates its buffer to contain the new content and fire a change event
- if you want the file to be saved, you would need to listen to that event and call commit on the ResourceDiffNode