mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Patch for Devin Steffler.
This patch gets rid of the work around added to CoreModel with the last patch. It was required in order to get C(PP)SelectionTests*Indexer working but the better way to do this is to create a scanner config for the projects for those tests. This patch also improves the speeds of CSelectionTestsCTagsIndexer and CPPSelectionTestsCTagsIndexer by adding CTagsIndexer#notifyListeners(IndexDelta) to Index.java.
This commit is contained in:
parent
cee31b91f4
commit
b208d1adfd
7 changed files with 54 additions and 12 deletions
|
@ -32,6 +32,7 @@ import org.eclipse.cdt.internal.core.index.cindexstorage.io.IndexInput;
|
|||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.IndexOutput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.MergeFactory;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.SimpleIndexInput;
|
||||
import org.eclipse.cdt.internal.core.index.ctagsindexer.CTagsIndexer;
|
||||
import org.eclipse.cdt.internal.core.index.impl.IndexDelta;
|
||||
import org.eclipse.cdt.internal.core.index.impl.Int;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.SourceIndexer;
|
||||
|
@ -315,6 +316,9 @@ public class Index implements IIndex, ICIndexStorageConstants, ICSearchConstants
|
|||
if (indexer instanceof SourceIndexer){
|
||||
IndexDelta indexDelta = new IndexDelta(null,null,IIndexDelta.MERGE_DELTA);
|
||||
((SourceIndexer) indexer).notifyListeners(indexDelta);
|
||||
} else if (indexer instanceof CTagsIndexer) {
|
||||
IndexDelta indexDelta = new IndexDelta(null,null,IIndexDelta.MERGE_DELTA);
|
||||
((CTagsIndexer) indexer).notifyListeners(indexDelta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1098,7 +1098,7 @@ public class CoreModel {
|
|||
|
||||
public static boolean isScannerInformationEmpty(IResource resource) {
|
||||
final int PATH_ENTRY_MASK = IPathEntry.CDT_INCLUDE | IPathEntry.CDT_MACRO |
|
||||
IPathEntry.CDT_INCLUDE_FILE | IPathEntry.CDT_MACRO_FILE | IPathEntry.CDT_SOURCE;
|
||||
IPathEntry.CDT_INCLUDE_FILE | IPathEntry.CDT_MACRO_FILE;
|
||||
boolean rc = true;
|
||||
IPath resPath = resource.getFullPath();
|
||||
IProject project = resource.getProject();
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
<import plugin="org.eclipse.compare"/>
|
||||
<import plugin="org.eclipse.ui.console"/>
|
||||
<import plugin="org.eclipse.core.expressions"/>
|
||||
<import plugin="org.eclipse.cdt.make.core"/>
|
||||
</requires>
|
||||
|
||||
<extension
|
||||
|
|
|
@ -16,6 +16,7 @@ import junit.framework.AssertionFailedError;
|
|||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.eclipse.cdt.core.CCProjectNature;
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
|
@ -26,8 +27,13 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
|||
import org.eclipse.cdt.internal.core.index.ctagsindexer.CTagsIndexer;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.SourceIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
|
||||
import org.eclipse.cdt.make.core.MakeProjectNature;
|
||||
import org.eclipse.cdt.make.core.scannerconfig.ScannerConfigNature;
|
||||
import org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IProjectDescription;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
|
@ -70,8 +76,12 @@ public class CPPSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer
|
|||
//Enable indexing on test project
|
||||
project.setSessionProperty(SourceIndexer.activationKey,new Boolean(true));
|
||||
|
||||
if (project==null)
|
||||
fail("Unable to create project"); //$NON-NLS-1$
|
||||
if (project==null) fail("Unable to create project"); //$NON-NLS-1$
|
||||
IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(project.getName());
|
||||
CCProjectNature.addCCNature(project,monitor);
|
||||
MakeProjectNature.addNature(project, new NullProgressMonitor());
|
||||
ScannerConfigNature.addScannerConfigNature(project);
|
||||
PerProjectSICollector.calculateCompilerBuiltins(project);
|
||||
|
||||
indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import junit.framework.AssertionFailedError;
|
|||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.eclipse.cdt.core.CCProjectNature;
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
|
@ -27,8 +28,13 @@ import org.eclipse.cdt.core.testplugin.CProjectHelper;
|
|||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.SourceIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
|
||||
import org.eclipse.cdt.make.core.MakeProjectNature;
|
||||
import org.eclipse.cdt.make.core.scannerconfig.ScannerConfigNature;
|
||||
import org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IProjectDescription;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
|
@ -69,8 +75,12 @@ public class CPPSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer imple
|
|||
//Enable indexing on test project
|
||||
project.setSessionProperty(SourceIndexer.activationKey,new Boolean(true));
|
||||
|
||||
if (project==null)
|
||||
fail("Unable to create project"); //$NON-NLS-1$
|
||||
if (project==null) fail("Unable to create project"); //$NON-NLS-1$
|
||||
IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(project.getName());
|
||||
CCProjectNature.addCCNature(project,monitor);
|
||||
MakeProjectNature.addNature(project, new NullProgressMonitor());
|
||||
ScannerConfigNature.addScannerConfigNature(project);
|
||||
PerProjectSICollector.calculateCompilerBuiltins(project);
|
||||
|
||||
indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
|
||||
|
||||
|
|
|
@ -26,8 +26,14 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
|||
import org.eclipse.cdt.internal.core.index.ctagsindexer.CTagsIndexer;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.SourceIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
|
||||
import org.eclipse.cdt.make.core.MakeProjectNature;
|
||||
import org.eclipse.cdt.make.core.scannerconfig.ScannerConfigNature;
|
||||
import org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IProjectDescription;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
|
@ -72,8 +78,11 @@ public class CSelectionTestsCTagsIndexer extends BaseSelectionTestsIndexer
|
|||
//Enable indexing on test project
|
||||
project.setSessionProperty(SourceIndexer.activationKey,new Boolean(true));
|
||||
|
||||
if (project==null)
|
||||
fail("Unable to create project"); //$NON-NLS-1$
|
||||
if (project==null) fail("Unable to create project"); //$NON-NLS-1$
|
||||
IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(project.getName());
|
||||
MakeProjectNature.addNature(project, new NullProgressMonitor());
|
||||
ScannerConfigNature.addScannerConfigNature(project);
|
||||
PerProjectSICollector.calculateCompilerBuiltins(project);
|
||||
|
||||
indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
|
||||
|
||||
|
|
|
@ -25,8 +25,13 @@ import org.eclipse.cdt.core.testplugin.CProjectHelper;
|
|||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.SourceIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
|
||||
import org.eclipse.cdt.make.core.MakeProjectNature;
|
||||
import org.eclipse.cdt.make.core.scannerconfig.ScannerConfigNature;
|
||||
import org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IProjectDescription;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
|
@ -67,8 +72,11 @@ public class CSelectionTestsDOMIndexer extends BaseSelectionTestsIndexer impleme
|
|||
//Enable indexing on test project
|
||||
project.setSessionProperty(SourceIndexer.activationKey,new Boolean(true));
|
||||
|
||||
if (project==null)
|
||||
fail("Unable to create project"); //$NON-NLS-1$
|
||||
if (project==null) fail("Unable to create project"); //$NON-NLS-1$
|
||||
IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(project.getName());
|
||||
MakeProjectNature.addNature(project, new NullProgressMonitor());
|
||||
ScannerConfigNature.addScannerConfigNature(project);
|
||||
PerProjectSICollector.calculateCompilerBuiltins(project);
|
||||
|
||||
indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue