Refresh resources before sync check in DeleteResourcesProcessor#4046
Refresh resources before sync check in DeleteResourcesProcessor#4046vogella wants to merge 2 commits into
Conversation
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
Test Results 861 files ±0 861 suites ±0 44m 3s ⏱️ - 8m 45s For more details on these errors, see this check. Results for commit 88d7f3e. ± Comparison against base commit d390a10. ♻️ This comment has been updated with latest results. |
629fa12 to
f5c49d1
Compare
When the workspace "Refresh on access" preference (Preferences > General > Workspace > "Refresh on access", backed by ResourcesPlugin.PREF_LIGHTWEIGHT_AUTO_REFRESH) is enabled, the Delete Resources refactoring wizard reports "is not in sync with" warnings even though the user explicitly opted into refresh on access. Note that this preference is enabled by default. DeleteResourcesProcessor now follows the same pattern as RenameResourceProcessor: if the sync check fails and the preference is enabled, the resource is refreshed and the check is repeated. Resources that are already in sync are not refreshed. If the refresh reveals that a resource was deleted externally, the resource is dropped from the set to delete instead of failing later in DeleteResourceChange with "resource does not exist". The refresh runs under a child progress monitor so it stays cancelable, and a failed refresh degrades to the existing out-of-sync warning rather than aborting the condition check. Fixes eclipse-platform#3982
f5c49d1 to
f6063dc
Compare
The Delete Resources refactoring wizard reported "is not in sync with" warnings for files that were changed outside Eclipse, even though the "Refresh on access" workspace preference promises a lazy refresh and is enabled by default. The sync check used
IResource.isSynchronized, which only compares timestamps and never triggers that refresh.DeleteResourcesProcessornow follows the same pattern asRenameResourceProcessor: when the preference (PREF_LIGHTWEIGHT_AUTO_REFRESH) is enabled and the sync check fails, the resource is refreshed and the check is repeated, so resources that are already in sync pay no refresh cost. If the refresh reveals that a resource was deleted externally, it is dropped from the deletion set instead of failing later with "resource does not exist". The refresh stays cancelable via a child progress monitor, and a failed refresh degrades to the existing out-of-sync warning.New tests cover the warning with the preference disabled, the refresh with it enabled, and the externally deleted case.
Fixes #3982