From 977f83abcfab9205c1c7374b100e2abba030b664 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Thu, 7 May 2026 12:52:49 +0200 Subject: [PATCH 1/2] Refresh resources before sync check in DeleteResourcesProcessor When the workspace "Refresh on access" preference (Preferences > General > Workspace > "Refresh on access", backed by ResourcesPlugin.PREF_LIGHTWEIGHT_AUTO_REFRESH) is enabled, refresh each resource before checking IResource.isSynchronized in DeleteResourcesProcessor. Without this, the Delete Resources refactoring wizard reports "is not in sync with" warnings even though the user explicitly opted into refresh on access. 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 https://github.com/eclipse-platform/eclipse.platform.ui/issues/3982 --- .../resource/DeleteResourcesProcessor.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/resource/DeleteResourcesProcessor.java b/bundles/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/resource/DeleteResourcesProcessor.java index c77f5e1e9d8..3c8280f1054 100644 --- a/bundles/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/resource/DeleteResourcesProcessor.java +++ b/bundles/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/resource/DeleteResourcesProcessor.java @@ -21,6 +21,8 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.SubMonitor; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; @@ -28,6 +30,7 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceVisitor; +import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.resources.mapping.IResourceChangeDescriptionFactory; import org.eclipse.core.filebuffers.FileBuffers; @@ -120,11 +123,21 @@ public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws Core @Override public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException, OperationCanceledException { - pm.beginTask("", 1); //$NON-NLS-1$ + SubMonitor subMonitor= SubMonitor.convert(pm, fResources.length); try { RefactoringStatus result= new RefactoringStatus(); + boolean lightweightAutoRefresh= Platform.getPreferencesService().getBoolean(ResourcesPlugin.PI_RESOURCES, + ResourcesPlugin.PREF_LIGHTWEIGHT_AUTO_REFRESH, false, null); + for (IResource resource : fResources) { + if (lightweightAutoRefresh && resource.isAccessible()) { + try { + resource.refreshLocal(IResource.DEPTH_INFINITE, subMonitor.split(1)); + } catch (CoreException e) { + // Refresh failed; fall through to the sync check, which reports the warning + } + } if (!isSynchronizedExcludingLinkedResources(resource)) { String pathLabel= BasicElementLabels.getPathLabel(resource.getFullPath(), false); From 629fa1217fc2dee519c443cc13800323543fb708 Mon Sep 17 00:00:00 2001 From: Eclipse Platform Bot Date: Mon, 1 Jun 2026 11:47:11 +0000 Subject: [PATCH 2/2] Version bump(s) for 4.41 stream --- bundles/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9f0f659919b..0933dc953b7 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