fc55f60
--- ./results/plugins/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScannerInfoPlus.java.fix	2006-08-29 14:28:17.000000000 -0400
fc55f60
+++ ./results/plugins/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScannerInfoPlus.java	2006-08-29 14:28:54.000000000 -0400
fc55f60
@@ -0,0 +1,16 @@
fc55f60
+package org.eclipse.cdt.core.parser;
fc55f60
+
fc55f60
+import org.eclipse.core.resources.IFile;
fc55f60
+import org.eclipse.core.resources.IResource;
fc55f60
+
fc55f60
+public interface IScannerInfoPlus extends IScannerInfo {
fc55f60
+
fc55f60
+	/**
fc55f60
+	 * Map an open include file as being included by a specific resource.
fc55f60
+	 * 
fc55f60
+	 * @param include the include file
fc55f60
+	 * @param res the resource that included the include file
fc55f60
+	 */
fc55f60
+	public void createIncludeChain(IFile include, IResource res);
fc55f60
+
fc55f60
+}
fc55f60
--- ./results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java.fix	2006-08-29 14:32:46.000000000 -0400
fc55f60
+++ ./results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java	2006-08-29 14:33:19.000000000 -0400
fc55f60
@@ -24,6 +24,7 @@ import org.eclipse.cdt.core.model.ICElem
fc55f60
 import org.eclipse.cdt.core.model.ICProject;
fc55f60
 import org.eclipse.cdt.core.model.ITranslationUnit;
fc55f60
 import org.eclipse.cdt.core.parser.IScannerInfo;
fc55f60
+import org.eclipse.cdt.core.parser.IScannerInfoPlus;
fc55f60
 import org.eclipse.cdt.core.parser.IScannerInfoProvider;
fc55f60
 import org.eclipse.cdt.internal.ui.CPluginImages;
fc55f60
 import org.eclipse.cdt.internal.ui.dialogs.ElementListSelectionDialog;
fc55f60
@@ -37,8 +38,10 @@ import org.eclipse.core.resources.IResou
fc55f60
 import org.eclipse.core.resources.IResourceProxyVisitor;
fc55f60
 import org.eclipse.core.resources.ResourcesPlugin;
fc55f60
 import org.eclipse.core.runtime.CoreException;
fc55f60
+import org.eclipse.core.runtime.IConfigurationElement;
fc55f60
 import org.eclipse.core.runtime.IPath;
fc55f60
 import org.eclipse.core.runtime.Path;
fc55f60
+import org.eclipse.core.runtime.QualifiedName;
fc55f60
 import org.eclipse.jface.action.Action;
fc55f60
 import org.eclipse.jface.viewers.ILabelProvider;
fc55f60
 import org.eclipse.jface.viewers.ISelection;
fc55f60
@@ -79,17 +82,16 @@ public class OpenIncludeAction extends A
fc55f60
 		if (include == null) {
fc55f60
 			return;
fc55f60
 		}
fc55f60
-		
fc55f60
 		try {
fc55f60
 			IResource res = include.getUnderlyingResource();
fc55f60
+			IScannerInfo info = null;
fc55f60
 			ArrayList filesFound = new ArrayList(4);
fc55f60
 			if (res != null) {
fc55f60
 				IProject proj = res.getProject();
fc55f60
 				String includeName = include.getElementName();
fc55f60
-				// Search in the scannerInfo information
fc55f60
-				IScannerInfoProvider provider =  CCorePlugin.getDefault().getScannerInfoProvider(proj);
fc55f60
+				IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(proj);
fc55f60
 				if (provider != null) {
fc55f60
-					IScannerInfo info = provider.getScannerInformation(res);
fc55f60
+					info = provider.getScannerInformation(res);
fc55f60
 					// XXXX this should fall back to project by itself
fc55f60
 					if (info == null) {
fc55f60
 						info = provider.getScannerInformation(proj);
fc55f60
@@ -110,7 +112,7 @@ public class OpenIncludeAction extends A
fc55f60
 			if (nElementsFound == 0) {
fc55f60
 				noElementsFound();
fc55f60
 				fileToOpen= null;
fc55f60
-			} else if (nElementsFound == 1) {
fc55f60
+			} else if (nElementsFound == 1 || info instanceof IScannerInfoPlus) {
fc55f60
 				fileToOpen= (IPath) filesFound.get(0);
fc55f60
 			} else {
fc55f60
 				fileToOpen= chooseFile(filesFound);
fc55f60
@@ -119,6 +121,11 @@ public class OpenIncludeAction extends A
fc55f60
 			if (fileToOpen != null) {
fc55f60
 				IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(fileToOpen);
fc55f60
 				if (file != null) {
fc55f60
+					// If dealing with an IScannerInfoPlus, we want to register
fc55f60
+					// the resource with the include file it includes.
fc55f60
+					if (info instanceof IScannerInfoPlus) {
fc55f60
+						((IScannerInfoPlus)info).createIncludeChain(file, res);
fc55f60
+					}
fc55f60
 					EditorUtility.openInEditor(file);
fc55f60
 				}  else {
fc55f60
 					ICProject cproject = include.getCProject();