Skip to content

Refresh resources before sync check in DeleteResourcesProcessor#4046

Open
vogella wants to merge 2 commits into
eclipse-platform:masterfrom
vogella:lv/delete-resources-honor-lightweight-auto-refresh
Open

Refresh resources before sync check in DeleteResourcesProcessor#4046
vogella wants to merge 2 commits into
eclipse-platform:masterfrom
vogella:lv/delete-resources-honor-lightweight-auto-refresh

Conversation

@vogella

@vogella vogella commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

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.

DeleteResourcesProcessor now follows the same pattern as RenameResourceProcessor: 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

@eclipse-platform-bot

eclipse-platform-bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF

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 patch
From 736e9087f4b940e766e677ff96a5a5372ca45d65 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Thu, 11 Jun 2026 17:25:25 +0000
Subject: [PATCH] Version bump(s) for 4.41 stream


diff --git a/bundles/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF b/bundles/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF
index 9f0f659919..0933dc953b 100644
--- a/bundles/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Automatic-Module-Name: org.eclipse.ltk.core.refactoring
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.ltk.core.refactoring; singleton:=true
-Bundle-Version: 3.15.200.qualifier
+Bundle-Version: 3.15.300.qualifier
 Bundle-Activator: org.eclipse.ltk.internal.core.refactoring.RefactoringCorePlugin
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: %providerName
-- 
2.54.0

Further information are available in Common Build Issues - Missing version increments.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Test Results

   861 files  ±0     861 suites  ±0   44m 3s ⏱️ - 8m 45s
 8 037 tests +3   7 793 ✅ +2  243 💤 ±0  0 ❌ ±0  1 🔥 +1 
20 545 runs  +4  19 889 ✅ +3  655 💤 ±0  0 ❌ ±0  1 🔥 +1 

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.

@vogella vogella force-pushed the lv/delete-resources-honor-lightweight-auto-refresh branch from 629fa12 to f5c49d1 Compare June 11, 2026 17:14
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
@vogella vogella force-pushed the lv/delete-resources-honor-lightweight-auto-refresh branch from f5c49d1 to f6063dc Compare June 11, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete resource does not honor the "Refresh on access" preference

2 participants