* introduce PatchInfo class to store timestamp for last patch parsing;
* change cached loaded patches map types to accept PatchInfo as a value;
* extract isPatchFileChangedOrNotLoaded method for future usages;
* add action on the toolbar;
* now preview wouldn't be changed if shelved patch file was changed;
* todo: need to Implement wrapped for properly refresh and implement
for binary shelved files also;
* for new and deleted files get content directly from patch/local file;
* for modified files:
- try to detect base if base found show diff local or base with
patch applied on base;
- if no base detected then show diff with local and patch applied
to local (maybe somehow);
move ProjectComponent.projectOpened out of event processing — it is part of project initialization contract, but message bus projectOpened it is just an event
MessageBus will fire all queued messages, so, if you will fire some event in your handler (projectOpened), all other handlers (projectOpened and other) will be fired. And this breaks expectation (other project opened handler must be invoked .
Fix: do not format in the middle (before the actual refactoring). Element gets invalidated before the actual operation. Also, it does not have much sense.
- in the platform part, I introduced additional callback to be called _after_ refactoring. I did not want to change the behaviour of other parts
- since the element is being deleted, after-reformatting should remove extra new lines/spaces, with respect to whether the element was inline
Special problem is evaluating the range where to remove new lines/spaces after the refactoring; in the presence of the fact that actually parent-of-the-parent of the passed element can be removed (if the was wrapping statement which does not contain no more meaningful elements)
That's why I am creating the collection of contexts around the element being deleted, and for its parents
One test became worse :( - with deleting also the js doc, which became empty
(UnusedLocalSymbols6)
Do not know how it managed to work before and I think in this particular case the extra newline does not cost the price of possible error, if we try to also process this
(cherry picked from commit 9f08aa4)