From 90a837665813a3993bd2c3e050ca12d7d99a7515 Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Thu, 1 Oct 2020 21:47:02 -0400 Subject: [PATCH] Add a comment to help explain one of the mysteries of SetCProjectDescriptionOperation I'm not sure how sufficient this explanation is but it's better than leaving just "// Why?" for that central piece of code in CDT. Change-Id: I0858f83b8f4fbe65fd869e96fb210b5af7d16f65 Signed-off-by: Marc-Andre Laperle --- .../settings/model/SetCProjectDescriptionOperation.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SetCProjectDescriptionOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SetCProjectDescriptionOperation.java index 5211a782a67..329046d18db 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SetCProjectDescriptionOperation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SetCProjectDescriptionOperation.java @@ -133,6 +133,13 @@ public class SetCProjectDescriptionOperation extends CModelOperation { fSetDescription, delta); cProject.close(); // Why? + // M-A.L: Here is an explanation I came up with from an investigation I did a long time ago (https://bugs.eclipse.org/bugs/show_bug.cgi?id=349564#c10) : + // "Some information in the CModel cache depends on the CProjectDescription. For example, + // CContainerInfo caches the non-C resources (like excluded files). By closing the CProject, + // that cache is deleted and rebuilt from CProjectDescription when needed. As a test, + // I removed this line and excluded some files then I could see the cache not + // being rebuilt and the icons for exclusion became out of sync." + // If you are tempted to remove this line please consider this. // ExternalSettingsManager.getInstance().updateDepentents(delta);