--- ./results/plugins/org.eclipse.cdt.core/schema/DynamicScannerInfoProvider.exsd.fix 2006-07-12 16:58:30.000000000 -0400
+++ ./results/plugins/org.eclipse.cdt.core/schema/DynamicScannerInfoProvider.exsd 2006-07-12 16:56:05.000000000 -0400
@@ -0,0 +1,105 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.cdt.core">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.cdt.core" id="DynamicScannerInfoProvider" name="Dynamic ScannerInfoProvider"/>
+ </appInfo>
+ <documentation>
+ ScannerInfoProvider that extracts from dynamic build info taken from makefiles.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="run"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="run">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Class which implements IScannerInfoProvider dynamically from makefile build.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.cdt.core.parser.IScannerInfoProvider"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+</schema>
--- ./results/plugins/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java.fix 2006-07-12 16:54:55.000000000 -0400
+++ ./results/plugins/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java 2006-07-12 16:56:05.000000000 -0400
@@ -856,6 +856,28 @@ public class CCorePlugin extends Plugin
}
return provider;
}
+
+ /**
+ * Get the dynamic IScannerInfoProvider contributed interface for the platform.
+ * @return IScannerInfoProvider or null
+ */
+ public IScannerInfoProvider getDynamicScannerInfoProvider() throws CoreException {
+ IScannerInfoProvider provider = null;
+ IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(CCorePlugin.PLUGIN_ID, "DynamicScannerInfoProvider"); //$NON-NLS-1$
+ if (extension != null) {
+ IExtension[] extensions = extension.getExtensions();
+ try {
+ if (extensions.length > 0) {
+ IConfigurationElement[] configElements = extensions[0].getConfigurationElements();
+ provider = (IScannerInfoProvider) configElements[0].createExecutableExtension("class");
+ }
+ return provider;
+ } catch (CoreException e) {
+ // log(e);
+ }
+ }
+ return null;
+ }
/**
* Helper function, returning the contenttype for a filename
--- ./results/plugins/org.eclipse.cdt.core/plugin.xml.fix 2006-07-12 16:54:19.000000000 -0400
+++ ./results/plugins/org.eclipse.cdt.core/plugin.xml 2006-07-12 16:56:05.000000000 -0400
@@ -44,6 +44,7 @@
<extension-point id="CodeFormatter" name="%CodeFormatter.name" schema="schema/CodeFormatter.exsd"/>
<extension-point id="CIndexer" name="C/C++ Indexer" schema="schema/CIndexer.exsd"/>
<extension-point id="language" name="%language.name" schema="schema/language.exsd"/>
+ <extension-point id="DynamicScannerInfoProvider" name="Dynamic ScannerInfoProvider" schema="schema/DynamicScannerInfoProvider.exsd"/>
<!-- =================================================================================== -->
<!-- Define the list of the Binary Parser provided by the CDT -->
<!-- =================================================================================== -->
--- ./results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java.fix 2006-07-12 16:55:40.000000000 -0400
+++ ./results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java 2006-07-12 16:56:05.000000000 -0400
@@ -37,8 +37,10 @@ import org.eclipse.core.resources.IResou
import org.eclipse.core.resources.IResourceProxyVisitor;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
@@ -79,30 +81,47 @@ public class OpenIncludeAction extends A
if (include == null) {
return;
}
-
try {
+ boolean dynamicIncludePathFound = false;
IResource res = include.getUnderlyingResource();
ArrayList filesFound = new ArrayList(4);
+ IResource resToScan = res;
+ QualifiedName dynamicScannerPrevFile = new QualifiedName("org.eclipse.cdt.core", "DynamicScannerPrevFile");
if (res != null) {
IProject proj = res.getProject();
String includeName = include.getElementName();
- // Search in the scannerInfo information
- IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(proj);
+ IScannerInfoProvider provider = CCorePlugin.getDefault().getDynamicScannerInfoProvider();
if (provider != null) {
- IScannerInfo info = provider.getScannerInformation(res);
- // XXXX this should fall back to project by itself
- if (info == null) {
- info = provider.getScannerInformation(proj);
- }
+ while (resToScan.getSessionProperty(dynamicScannerPrevFile) != null)
+ resToScan = (IResource)resToScan.getSessionProperty(dynamicScannerPrevFile);
+ IScannerInfo info = provider.getScannerInformation(resToScan);
if (info != null) {
String[] includePaths = info.getIncludePaths();
HashSet found = new HashSet();
findFile(includePaths, includeName, filesFound, found);
}
- if (filesFound.size() == 0) {
- // Fall back and search the project
- findFile(proj, new Path(includeName), filesFound);
+ }
+ if (filesFound.size() == 0) {
+ // Search in the scannerInfo information
+ provider = CCorePlugin.getDefault().getScannerInfoProvider(proj);
+ if (provider != null) {
+ IScannerInfo info = provider.getScannerInformation(res);
+ // XXXX this should fall back to project by itself
+ if (info == null) {
+ info = provider.getScannerInformation(proj);
+ }
+ if (info != null) {
+ String[] includePaths = info.getIncludePaths();
+ HashSet found = new HashSet();
+ findFile(includePaths, includeName, filesFound, found);
+ }
+ if (filesFound.size() == 0) {
+ // Fall back and search the project
+ findFile(proj, new Path(includeName), filesFound);
+ }
}
+ } else {
+ dynamicIncludePathFound = true;
}
}
IPath fileToOpen;
@@ -110,7 +129,7 @@ public class OpenIncludeAction extends A
if (nElementsFound == 0) {
noElementsFound();
fileToOpen= null;
- } else if (nElementsFound == 1) {
+ } else if (nElementsFound == 1 || dynamicIncludePathFound) {
fileToOpen= (IPath) filesFound.get(0);
} else {
fileToOpen= chooseFile(filesFound);
@@ -119,6 +138,8 @@ public class OpenIncludeAction extends A
if (fileToOpen != null) {
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(fileToOpen);
if (file != null) {
+ if (dynamicIncludePathFound)
+ file.setSessionProperty(dynamicScannerPrevFile, resToScan);
EditorUtility.openInEditor(file);
} else {
ICProject cproject = include.getCProject();