mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 18:05:33 +02:00
Dave Daoust's patch for 91946 w/ Modifications
Cleaned up deprecated Search UI
This commit is contained in:
parent
fed558e7fc
commit
cf1d5bf0d1
45 changed files with 1132 additions and 1210 deletions
|
@ -32,8 +32,8 @@ import org.eclipse.cdt.core.testplugin.CTestPlugin;
|
|||
import org.eclipse.cdt.internal.core.index.IEntryResult;
|
||||
import org.eclipse.cdt.internal.core.index.IIndex;
|
||||
import org.eclipse.cdt.internal.core.index.IQueryResult;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.SourceIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
@ -199,7 +199,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
IIndex ind = sourceIndexer.getIndex(testProject.getFullPath(),true,true);
|
||||
assertTrue("Index exists for project",ind != null); //$NON-NLS-1$
|
||||
|
||||
char[] prefix = "typeDecl/".toCharArray(); //$NON-NLS-1$
|
||||
char[] prefix = IndexerOutput.TYPE_DECL; //$NON-NLS-1$
|
||||
IQueryResult[] qresults = ind.queryPrefix(prefix);
|
||||
IEntryResult[] eresults = ind.queryEntries(prefix);
|
||||
|
||||
|
@ -261,7 +261,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
char[] prefix = "typeDecl/C/CDocumentManager".toCharArray(); //$NON-NLS-1$
|
||||
String [] entryResultModel ={"EntryResult: word=typeDecl/C/CDocumentManager, refs={ 2 }, offsets={ [ 2127] }"}; //$NON-NLS-1$
|
||||
IEntryResult[] eresults =ind.queryEntries(prefix);
|
||||
IEntryResult[] bogRe = ind.queryEntries(IIndexConstants.TYPE_DECL);
|
||||
IEntryResult[] bogRe = ind.queryEntries(IndexerOutput.TYPE_DECL);
|
||||
assertTrue("Entry Result exists", eresults != null); //$NON-NLS-1$
|
||||
|
||||
if (eresults.length != entryResultModel.length)
|
||||
|
@ -322,7 +322,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
|
||||
//Do a "before" deletion comparison
|
||||
//ind = indexManager.getIndex(testProjectPath,true,true);
|
||||
char[] prefix = "typeDecl/".toCharArray(); //$NON-NLS-1$
|
||||
char[] prefix = IndexerOutput.TYPE_DECL; //$NON-NLS-1$
|
||||
IEntryResult[] eresults = ind.queryEntries(prefix);
|
||||
assertTrue("Entry result found for typdeDecl/", eresults != null); //$NON-NLS-1$
|
||||
|
||||
|
@ -383,7 +383,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
IIndex ind = sourceIndexer.getIndex(testProjectPath,true,true);
|
||||
assertTrue("Index exists for project",ind != null); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
IEntryResult[] typerefreesults = ind.queryEntries(IIndexConstants.TYPE_REF);
|
||||
IEntryResult[] typerefreesults = ind.queryEntries(IndexerOutput.TYPE_REF);
|
||||
assertTrue("Type Ref Results exist", typerefreesults != null); //$NON-NLS-1$
|
||||
|
||||
String [] typeDeclEntryResultModel ={"EntryResult: word=typeDecl/C/Mail/Y/X/Z, refs={ 1 }, offsets={ [ 2335] }","EntryResult: word=typeDecl/C/Unknown/Y/X/Z, refs={ 1 }, offsets={ [ 21063] }", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
@ -396,7 +396,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
"EntryResult: word=typeDecl/V/temp, refs={ 1 }, offsets={ [ 22463] }", "EntryResult: word=typeDecl/V/x, refs={ 1 }, offsets={ [ 21589, 21965] }", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"EntryResult: word=typeDecl/V/x/Z, refs={ 1 }, offsets={ [ 2259] }"}; //$NON-NLS-1$
|
||||
|
||||
IEntryResult[] typedeclresults =ind.queryEntries(IIndexConstants.TYPE_DECL);
|
||||
IEntryResult[] typedeclresults =ind.queryEntries(IndexerOutput.TYPE_DECL);
|
||||
assertTrue("Type Decl Results exist", typedeclresults != null); //$NON-NLS-1$
|
||||
|
||||
if (typedeclresults.length != typeDeclEntryResultModel.length)
|
||||
|
@ -408,7 +408,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
}
|
||||
|
||||
String [] typeDefEntryResultModel ={"EntryResult: word=typeDecl/T/int32, refs={ 1 }, offsets={ [ 2200] }"}; //$NON-NLS-1$
|
||||
IEntryResult[] typedefresults =ind.queryEntries(IIndexConstants.TYPEDEF_DECL);
|
||||
IEntryResult[] typedefresults =ind.queryEntries((new String(IndexerOutput.TYPE_DECL) + IndexerOutput.TYPEDEF_SUFFIX).toCharArray());
|
||||
assertTrue("Type Def Results exist", typedefresults != null); //$NON-NLS-1$
|
||||
|
||||
if (typedefresults.length != typeDefEntryResultModel.length)
|
||||
|
@ -422,7 +422,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
String [] namespaceResultModel = {"EntryResult: word=namespaceDecl/X/Z, refs={ 1 }, offsets={ [ 2274] }", "EntryResult: word=namespaceDecl/Y/X/Z, refs={ 1 }, offsets={ [ 2290] }", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"EntryResult: word=namespaceDecl/Z, refs={ 1 }, offsets={ [ 2250] }"}; //$NON-NLS-1$
|
||||
|
||||
IEntryResult[] namespaceresults =ind.queryEntries(IIndexConstants.NAMESPACE_DECL);
|
||||
IEntryResult[] namespaceresults =ind.queryEntries(IndexerOutput.NAMESPACE_DECL);
|
||||
assertTrue("Namespace Results exist", namespaceresults != null); //$NON-NLS-1$
|
||||
|
||||
if (namespaceresults.length != namespaceResultModel.length)
|
||||
|
@ -436,7 +436,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
String [] fieldResultModel = {"EntryResult: word=fieldDecl/array/container/Y/X/Z, refs={ 1 }, offsets={ [ 21485] }", "EntryResult: word=fieldDecl/index/container/Y/X/Z, refs={ 1 }, offsets={ [ 21500] }",
|
||||
"EntryResult: word=fieldDecl/postage/Mail/Y/X/Z, refs={ 1 }, offsets={ [ 2469] }", "EntryResult: word=fieldDecl/sz/container/Y/X/Z, refs={ 1 }, offsets={ [ 21515] }",
|
||||
"EntryResult: word=fieldDecl/type/Mail/Y/X/Z, refs={ 1 }, offsets={ [ 2488] }"}; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
IEntryResult[] fieldresults =ind.queryEntries(IIndexConstants.FIELD_DECL);
|
||||
IEntryResult[] fieldresults =ind.queryEntries(IndexerOutput.FIELD_DECL);
|
||||
assertTrue("Field Results exist", fieldresults != null); //$NON-NLS-1$
|
||||
|
||||
if (fieldresults.length != fieldResultModel.length)
|
||||
|
@ -450,7 +450,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
String [] enumeratorResultModel = {"EntryResult: word=enumtorDecl/bye/Y/X/Z, refs={ 1 }, offsets={ [ 2315] }", "EntryResult: word=enumtorDecl/cool/Y/X/Z, refs={ 1 }, offsets={ [ 2307] }",
|
||||
"EntryResult: word=enumtorDecl/hi/Y/X/Z, refs={ 1 }, offsets={ [ 2312] }", "EntryResult: word=enumtorDecl/why/Y/X/Z, refs={ 1 }, offsets={ [ 2319] }"};
|
||||
|
||||
IEntryResult[] enumeratorresults =ind.queryEntries(IIndexConstants.ENUMTOR_DECL);
|
||||
IEntryResult[] enumeratorresults =ind.queryEntries(IndexerOutput.ENUMTOR_DECL);
|
||||
assertTrue("Enumerator Results exist", enumeratorresults != null); //$NON-NLS-1$
|
||||
|
||||
if (enumeratorresults.length != enumeratorResultModel.length)
|
||||
|
@ -462,7 +462,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
}
|
||||
|
||||
String [] functionResultModel = {"EntryResult: word=functionDecl/doSomething, refs={ 1 }, offsets={ [ 2222] }", "EntryResult: word=functionDecl/main/Y/X/Z, refs={ 1 }, offsets={ [ 21765] }"}; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
IEntryResult[] functionresults =ind.queryEntries(IIndexConstants.FUNCTION_DECL);
|
||||
IEntryResult[] functionresults =ind.queryEntries(IndexerOutput.FUNCTION_DECL);
|
||||
|
||||
if (functionresults.length != functionResultModel.length)
|
||||
fail("Entry Result length different from model for functionDecl"); //$NON-NLS-1$
|
||||
|
@ -489,7 +489,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
|
||||
|
||||
|
||||
IEntryResult[] methodresults =ind.queryEntries(IIndexConstants.METHOD_DECL);
|
||||
IEntryResult[] methodresults =ind.queryEntries(IndexerOutput.METHOD_DECL);
|
||||
assertTrue("Entry exists", methodresults != null); //$NON-NLS-1$
|
||||
|
||||
if (methodresults.length != methodResultModel.length)
|
||||
|
@ -515,7 +515,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
"EntryResult: word=typeRef/G/ForwardA/A, refs={ 1 }, offsets={ [ 225] }",
|
||||
"EntryResult: word=typeRef/V/x/B/A, refs={ 1 }, offsets={ [ 2128] }"};
|
||||
|
||||
IEntryResult[] typerefresults = ind.queryEntries(IIndexConstants.TYPE_REF);
|
||||
IEntryResult[] typerefresults = ind.queryEntries(IndexerOutput.TYPE_REF);
|
||||
assertTrue("Entry exists",typerefresults != null); //$NON-NLS-1$
|
||||
|
||||
if (typerefresults.length != typeRefEntryResultModel.length)
|
||||
|
@ -527,7 +527,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
}
|
||||
|
||||
String [] funRefEntryResultModel ={"EntryResult: word=functionRef/something/A, refs={ 1 }, offsets={ [ 259] }"};//$NON-NLS-1$
|
||||
IEntryResult[] funRefresults = ind.queryEntries(IIndexConstants.FUNCTION_REF);
|
||||
IEntryResult[] funRefresults = ind.queryEntries(IndexerOutput.FUNCTION_REF);
|
||||
assertTrue("Entry exists",funRefresults != null); //$NON-NLS-1$
|
||||
|
||||
if (funRefresults.length != funRefEntryResultModel.length)
|
||||
|
@ -539,7 +539,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
}
|
||||
|
||||
String [] namespaceRefResultModel = {"EntryResult: word=namespaceRef/A, refs={ 1 }, offsets={ [ 210] }", "EntryResult: word=namespaceRef/B/A, refs={ 1 }, offsets={ [ 288] }"}; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
IEntryResult[] namespacerefresults = ind.queryEntries(IIndexConstants.NAMESPACE_REF);
|
||||
IEntryResult[] namespacerefresults = ind.queryEntries(IndexerOutput.NAMESPACE_REF);
|
||||
assertTrue("Entry exists",namespacerefresults!=null); //$NON-NLS-1$
|
||||
|
||||
if (namespacerefresults.length != namespaceRefResultModel.length)
|
||||
|
@ -551,7 +551,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
}
|
||||
|
||||
String [] fieldRefResultModel = {"EntryResult: word=fieldRef/y/C/B/A, refs={ 1 }, offsets={ [ 2161] }"}; //$NON-NLS-1$
|
||||
IEntryResult[] fieldrefresults = ind.queryEntries(IIndexConstants.FIELD_REF);
|
||||
IEntryResult[] fieldrefresults = ind.queryEntries(IndexerOutput.FIELD_REF);
|
||||
assertTrue("Entry exists",fieldrefresults!=null); //$NON-NLS-1$
|
||||
|
||||
if (fieldrefresults.length != fieldRefResultModel.length)
|
||||
|
@ -563,7 +563,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
}
|
||||
|
||||
String [] methodRefResultModel = {"EntryResult: word=methodRef/bar/C/B/A, refs={ 1 }, offsets={ [ 2184] }"}; //$NON-NLS-1$
|
||||
IEntryResult[] methodrefresults = ind.queryEntries(IIndexConstants.METHOD_REF);
|
||||
IEntryResult[] methodrefresults = ind.queryEntries(IndexerOutput.METHOD_REF);
|
||||
assertTrue("Entry exists", methodrefresults != null); //$NON-NLS-1$
|
||||
|
||||
if (methodrefresults.length != methodRefResultModel.length)
|
||||
|
@ -577,7 +577,6 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
|
||||
public void testExactDeclarations() throws Exception
|
||||
{
|
||||
//TODO Bogdan - you may want to import c.h here a.h includes it! - JC
|
||||
importFile("a.h","resources/dependency/a.h");//$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
//Make sure project got added to index
|
||||
|
@ -588,8 +587,8 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
importFile("DepTest3.h","resources/dependency/DepTest3.h");//$NON-NLS-1$ //$NON-NLS-2$
|
||||
importFile("DepTest3.cpp","resources/dependency/DepTest3.cpp");//$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
IEntryResult[] eResult = ind.queryEntries(IIndexConstants.CLASS_DECL);
|
||||
IQueryResult[] qResult = ind.queryPrefix(IIndexConstants.CLASS_DECL);
|
||||
IEntryResult[] eResult = ind.queryEntries((new String(IndexerOutput.TYPE_DECL) + IndexerOutput.CLASS_SUFFIX).toCharArray());
|
||||
IQueryResult[] qResult = ind.queryPrefix((new String(IndexerOutput.TYPE_DECL) + IndexerOutput.CLASS_SUFFIX).toCharArray());
|
||||
|
||||
assertTrue("Expected 2 files indexed", qResult.length == 2); //$NON-NLS-1$
|
||||
assertTrue("Checking DepTest3.h location", qResult[0].getPath().equals("/IndexerTestProject/DepTest3.h")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
@ -656,7 +655,7 @@ public class SourceIndexerTests extends TestCase implements IIndexChangeListener
|
|||
IIndex ind = sourceIndexer.getIndex(testProjectPath,true,true);
|
||||
assertTrue("Index exists for project",ind != null); //$NON-NLS-1$
|
||||
|
||||
IEntryResult[] macroresults = ind.queryEntries(IIndexConstants.MACRO_DECL);
|
||||
IEntryResult[] macroresults = ind.queryEntries(IndexerOutput.MACRO_DECL);
|
||||
assertTrue("Entry exists", macroresults != null); //$NON-NLS-1$
|
||||
|
||||
String [] macroResultModel = {"EntryResult: word=macroDecl/CASE, refs={ 1 }, offsets={ [ 2131] }",
|
||||
|
|
|
@ -211,8 +211,8 @@ public class CPathEntryTest extends TestCase {
|
|||
}
|
||||
|
||||
};
|
||||
CoreModel.getDefault().setRawPathEntries(testProject, new IPathEntry[]{containerEntry}, new NullProgressMonitor());
|
||||
CoreModel.getDefault().setPathEntryContainer(new ICProject[]{testProject}, container, new NullProgressMonitor());
|
||||
CoreModel.setRawPathEntries(testProject, new IPathEntry[]{containerEntry}, new NullProgressMonitor());
|
||||
CoreModel.setPathEntryContainer(new ICProject[]{testProject}, container, new NullProgressMonitor());
|
||||
IPathEntry[] entries = testProject.getResolvedPathEntries();
|
||||
// We always have at least two entries:
|
||||
// 1) the default sourceEntry becomes the project
|
||||
|
|
|
@ -10,7 +10,6 @@ import junit.framework.TestSuite;
|
|||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.IInclude;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.internal.core.model.CElement;
|
||||
|
||||
/**
|
||||
* @author bnicolle
|
||||
|
|
|
@ -12,7 +12,6 @@ package org.eclipse.cdt.core.parser.tests;
|
|||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.cdt.core.parser.ParserFactory;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTExpression;
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.List;
|
|||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.eclipse.cdt.core.parser.ParserLanguage;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTFunction;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTVariable;
|
||||
|
|
|
@ -385,7 +385,7 @@ public class ParserSymbolTableTest extends TestCase {
|
|||
compUnit.addSymbol( c );
|
||||
compUnit.addSymbol( d );
|
||||
|
||||
IContainerSymbol enum = table.newContainerSymbol( "enum".toCharArray(), ITypeInfo.t_enumeration ); //$NON-NLS-1$
|
||||
IContainerSymbol enum1 = table.newContainerSymbol( "enum".toCharArray(), ITypeInfo.t_enumeration ); //$NON-NLS-1$
|
||||
|
||||
ISymbol enumerator = table.newSymbol( "enumerator".toCharArray(), ITypeInfo.t_enumerator ); //$NON-NLS-1$
|
||||
|
||||
|
@ -394,11 +394,11 @@ public class ParserSymbolTableTest extends TestCase {
|
|||
|
||||
ISymbol x = table.newSymbol( "x".toCharArray(), ITypeInfo.t_int ); //$NON-NLS-1$
|
||||
|
||||
d.addSymbol( enum );
|
||||
d.addSymbol( enum1 );
|
||||
d.addSymbol( stat );
|
||||
d.addSymbol( x );
|
||||
|
||||
enum.addSymbol( enumerator );
|
||||
enum1.addSymbol( enumerator );
|
||||
|
||||
a.addParent( b );
|
||||
a.addParent( c );
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.eclipse.cdt.core.parser.tests;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
@ -8,7 +7,6 @@ import java.lang.reflect.Modifier;
|
|||
import java.util.HashMap;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.FactoryConfigurationError;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
|
|
|
@ -18,8 +18,6 @@ import java.io.FileInputStream;
|
|||
import junit.framework.TestCase;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.ICDescriptor;
|
||||
import org.eclipse.cdt.core.ICExtensionReference;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.search.BasicSearchResultCollector;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants;
|
||||
|
@ -31,7 +29,6 @@ import org.eclipse.cdt.core.testplugin.CProjectHelper;
|
|||
import org.eclipse.cdt.core.testplugin.CTestPlugin;
|
||||
import org.eclipse.cdt.core.testplugin.FileManager;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.SourceIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
|
|
|
@ -9,7 +9,6 @@ package org.eclipse.cdt.core.suite;
|
|||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.cdescriptor.tests.CDescriptorTests;
|
||||
import org.eclipse.cdt.core.filetype.tests.ResolverTests;
|
||||
import org.eclipse.cdt.core.indexer.tests.DependencyTests;
|
||||
|
|
|
@ -18,9 +18,9 @@ import org.eclipse.cdt.internal.core.CharOperation;
|
|||
import org.eclipse.cdt.internal.core.index.IEntryResult;
|
||||
import org.eclipse.cdt.internal.core.index.IIndex;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.BlocksIndexInput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.IndexInput;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
@ -59,7 +59,7 @@ public class IndexerDependenciesJob extends IndexerJob {
|
|||
if (progressMonitor.isCanceled())
|
||||
throw new InterruptedException();
|
||||
|
||||
IEntryResult[] includeEntries = input.queryEntriesPrefixedBy(IIndexConstants.INCLUDE_REF);
|
||||
IEntryResult[] includeEntries = input.queryEntriesPrefixedBy(IndexerOutput.INCLUDE_REF);
|
||||
if (includeEntries != null) {
|
||||
//TODO subprogress monitor
|
||||
for (int i = 0; i < includeEntries.length; ++i) {
|
||||
|
@ -90,7 +90,7 @@ public class IndexerDependenciesJob extends IndexerJob {
|
|||
|
||||
private IPath getIncludePath(IEntryResult entry) {
|
||||
char[] word = entry.getWord();
|
||||
int firstSlash = CharOperation.indexOf(IIndexConstants.SEPARATOR, word, 0);
|
||||
int firstSlash = CharOperation.indexOf(IndexerOutput.SEPARATOR, word, 0);
|
||||
String include = String.valueOf(CharOperation.subarray(word, firstSlash + 1, -1));
|
||||
return PathUtil.getWorkspaceRelativePath(include);
|
||||
}
|
||||
|
|
|
@ -23,9 +23,9 @@ import org.eclipse.cdt.internal.core.CharOperation;
|
|||
import org.eclipse.cdt.internal.core.index.IEntryResult;
|
||||
import org.eclipse.cdt.internal.core.index.IIndex;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.BlocksIndexInput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.IndexInput;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
@ -63,7 +63,7 @@ public class IndexerTypesJob extends IndexerJob {
|
|||
if (monitor.isCanceled())
|
||||
throw new InterruptedException();
|
||||
|
||||
IEntryResult[] namespaceEntries = input.queryEntriesPrefixedBy(IIndexConstants.NAMESPACE_DECL);
|
||||
IEntryResult[] namespaceEntries = input.queryEntriesPrefixedBy(IndexerOutput.NAMESPACE_DECL);
|
||||
if (namespaceEntries != null) {
|
||||
//TODO subprogress monitor
|
||||
for (int i = 0; i < namespaceEntries.length; ++i) {
|
||||
|
@ -72,8 +72,8 @@ public class IndexerTypesJob extends IndexerJob {
|
|||
|
||||
IEntryResult entry = namespaceEntries[i];
|
||||
char[] word = entry.getWord();
|
||||
int firstSlash = CharOperation.indexOf(IIndexConstants.SEPARATOR, word, 0);
|
||||
int slash = CharOperation.indexOf(IIndexConstants.SEPARATOR, word, firstSlash + 1);
|
||||
int firstSlash = CharOperation.indexOf(IndexerOutput.SEPARATOR, word, 0);
|
||||
int slash = CharOperation.indexOf(IndexerOutput.SEPARATOR, word, firstSlash + 1);
|
||||
String name = String.valueOf(CharOperation.subarray(word, firstSlash + 1, slash));
|
||||
if (name.length() != 0) {
|
||||
String[] enclosingNames = getEnclosingNames(word, slash);
|
||||
|
@ -88,7 +88,7 @@ public class IndexerTypesJob extends IndexerJob {
|
|||
if (monitor.isCanceled())
|
||||
throw new InterruptedException();
|
||||
|
||||
IEntryResult[] typeEntries = input.queryEntriesPrefixedBy(IIndexConstants.TYPE_DECL);
|
||||
IEntryResult[] typeEntries = input.queryEntriesPrefixedBy(IndexerOutput.TYPE_DECL);
|
||||
if (typeEntries != null) {
|
||||
//TODO subprogress monitor
|
||||
for (int i = 0; i < typeEntries.length; ++i) {
|
||||
|
@ -97,20 +97,20 @@ public class IndexerTypesJob extends IndexerJob {
|
|||
|
||||
IEntryResult entry = typeEntries[i];
|
||||
char[] word = entry.getWord();
|
||||
int firstSlash = CharOperation.indexOf(IIndexConstants.SEPARATOR, word, 0);
|
||||
int firstSlash = CharOperation.indexOf(IndexerOutput.SEPARATOR, word, 0);
|
||||
char decodedType = word[firstSlash + 1];
|
||||
int type = getElementType(decodedType);
|
||||
if (type != 0) {
|
||||
firstSlash += 2;
|
||||
int slash = CharOperation.indexOf(IIndexConstants.SEPARATOR, word, firstSlash + 1);
|
||||
int slash = CharOperation.indexOf(IndexerOutput.SEPARATOR, word, firstSlash + 1);
|
||||
String name = String.valueOf(CharOperation.subarray(word, firstSlash + 1, slash));
|
||||
if (name.length() != 0) { // skip anonymous structs
|
||||
String[] enclosingNames = getEnclosingNames(word, slash);
|
||||
addType(input, project, entry, type, name, enclosingNames, monitor);
|
||||
}
|
||||
} else if (decodedType == IIndexConstants.DERIVED_SUFFIX) {
|
||||
} else if (decodedType == IndexerOutput.DERIVED_SUFFIX) {
|
||||
firstSlash += 2;
|
||||
int slash = CharOperation.indexOf(IIndexConstants.SEPARATOR, word, firstSlash + 1);
|
||||
int slash = CharOperation.indexOf(IndexerOutput.SEPARATOR, word, firstSlash + 1);
|
||||
String name = String.valueOf(CharOperation.subarray(word, firstSlash + 1, slash));
|
||||
if (name.length() != 0) { // skip anonymous structs
|
||||
String[] enclosingNames = getEnclosingNames(word, slash);
|
||||
|
@ -123,15 +123,15 @@ public class IndexerTypesJob extends IndexerJob {
|
|||
|
||||
private int getElementType(char decodedType) {
|
||||
switch (decodedType) {
|
||||
case IIndexConstants.CLASS_SUFFIX :
|
||||
case IndexerOutput.CLASS_SUFFIX :
|
||||
return ICElement.C_CLASS;
|
||||
case IIndexConstants.STRUCT_SUFFIX :
|
||||
case IndexerOutput.STRUCT_SUFFIX :
|
||||
return ICElement.C_STRUCT;
|
||||
case IIndexConstants.TYPEDEF_SUFFIX :
|
||||
case IndexerOutput.TYPEDEF_SUFFIX :
|
||||
return ICElement.C_TYPEDEF;
|
||||
case IIndexConstants.ENUM_SUFFIX :
|
||||
case IndexerOutput.ENUM_SUFFIX :
|
||||
return ICElement.C_ENUMERATION;
|
||||
case IIndexConstants.UNION_SUFFIX :
|
||||
case IndexerOutput.UNION_SUFFIX :
|
||||
return ICElement.C_UNION;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -18,14 +18,67 @@ import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
|||
*/
|
||||
|
||||
public interface IIndexerOutput {
|
||||
public void addRef(int indexedFileNumber, char[] word);
|
||||
public void addRef(int indexedFileNumber, char[] word, int offset, int offsetLength, int offsetType);
|
||||
public void addRef(int indexedFileNumber, String word, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addEnumtorDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addEnumtorRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addMacroDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addMacroRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addFieldDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addFieldRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addMethodDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addMethodRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addFunctionDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addFunctionRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addNamespaceDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addNamespaceRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addIncludeRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addStructDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addStructRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addTypedefDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addTypedefRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addUnionDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addUnionRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addVariableDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addVariableRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addClassDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addClassRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addEnumDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addEnumRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addDerivedDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addDerivedRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addFriendDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addFriendRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addVarDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addVarRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addFwd_ClassDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addFwd_ClassRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addFwd_StructDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addFwd_StructRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public void addFwd_UnionDecl(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
public void addFwd_UnionRef(int indexedFileNumber, char [][] name, int offset, int offsetLength, int offsetType);
|
||||
|
||||
public IndexedFileEntry getIndexedFile(String path);
|
||||
public IndexedFileEntry addIndexedFile(String path);
|
||||
//For Dep Tree
|
||||
public void addIncludeRef(int indexedFileNumber, char[] word);
|
||||
// public void addIncludeRef(int indexedFileNumber, char[] word);
|
||||
public void addIncludeRef(int indexedFileNumber, String word);
|
||||
public void addRelatives(int indexedFileNumber, String inclusion, String parent);
|
||||
}
|
||||
|
|
|
@ -46,18 +46,6 @@ public interface ICIndexStorageConstants {
|
|||
final static int ENUMTOR = 7;
|
||||
final static int INCLUDE = 8;
|
||||
|
||||
final static char[][] encodings = {
|
||||
new char[] {' '}, // not used
|
||||
"type".toCharArray(), // TYPES //$NON-NLS-1$
|
||||
"function".toCharArray(), // FUNCTIONS //$NON-NLS-1$
|
||||
"method".toCharArray(), // METHODS //$NON-NLS-1$
|
||||
"field".toCharArray(), // FIELDS //$NON-NLS-1$
|
||||
"macro".toCharArray(), // MACROS //$NON-NLS-1$
|
||||
"namespace".toCharArray(), // NAMESPACES //$NON-NLS-1$
|
||||
"enumtor".toCharArray(), // ENUMERATORS //$NON-NLS-1$
|
||||
"include".toCharArray() // INCLUDES //$NON-NLS-1$
|
||||
};
|
||||
|
||||
/**
|
||||
* Encoding types
|
||||
*/
|
||||
|
@ -65,13 +53,6 @@ public interface ICIndexStorageConstants {
|
|||
final static int REFERENCE = 2;
|
||||
final static int DEFINITION = 3;
|
||||
|
||||
final static char[][] encodingTypes = {
|
||||
new char[] {' '}, // not used
|
||||
"Decl/".toCharArray(), // DECLARATIONS //$NON-NLS-1$
|
||||
"Ref/".toCharArray(), // REFERENCES //$NON-NLS-1$
|
||||
"Defn/".toCharArray() // DEFINTIONS //$NON-NLS-1$
|
||||
};
|
||||
|
||||
/**
|
||||
* Encoding constants used in CIndexStorage
|
||||
*/
|
||||
|
@ -86,22 +67,7 @@ public interface ICIndexStorageConstants {
|
|||
final static int TYPE_FWD_CLASS = 9;
|
||||
final static int TYPE_FWD_STRUCT = 10;
|
||||
final static int TYPE_FWD_UNION = 11;
|
||||
|
||||
final static char[] typeConstants = {
|
||||
' ', // not used
|
||||
'C', // CLASS
|
||||
'S', // STRUCT
|
||||
'U', // UNION
|
||||
'E', // ENUM
|
||||
'V', // VAR
|
||||
'T', // TYPEDEF
|
||||
'D', // DERIVED
|
||||
'F', // FRIEND
|
||||
'G', // FWD_CLASS
|
||||
'H', // FWD_STRUCT
|
||||
'I' // FWD_UNION
|
||||
};
|
||||
|
||||
|
||||
//Used for offsets
|
||||
final static int LINE=1;
|
||||
final static int OFFSET=2;
|
||||
|
|
|
@ -10,14 +10,54 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.index.cindexstorage;
|
||||
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants;
|
||||
import org.eclipse.cdt.internal.core.CharOperation;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexerOutput;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.AbstractIndexer;
|
||||
|
||||
/**
|
||||
* An indexerOutput is used by an indexer to add files and word references to
|
||||
* an inMemoryIndex.
|
||||
*/
|
||||
|
||||
public class IndexerOutput implements IIndexerOutput {
|
||||
public class IndexerOutput implements IIndexerOutput, ICIndexStorageConstants, ICSearchConstants {
|
||||
|
||||
static final public char CLASS_SUFFIX = 'C'; // CLASS
|
||||
static final public char DERIVED_SUFFIX = 'D'; // DERIVED
|
||||
static final public char ENUM_SUFFIX = 'E'; // ENUM
|
||||
static final public char FRIEND_SUFFIX = 'F'; // FRIEND
|
||||
static final public char FWD_CLASS_SUFFIX = 'G'; // FWD_CLASS
|
||||
static final public char FWD_STRUCT_SUFFIX = 'H'; // FWD_STRUCT
|
||||
static final public char FWD_UNION_SUFFIX = 'I'; // FWD_UNION
|
||||
static final public char STRUCT_SUFFIX = 'S'; // STRUCT
|
||||
static final public char TYPEDEF_SUFFIX = 'T'; // TYPEDEF
|
||||
static final public char UNION_SUFFIX = 'U'; // UNION
|
||||
static final public char VAR_SUFFIX = 'V'; // VAR
|
||||
|
||||
final public static char SEPARATOR= '/';
|
||||
|
||||
static public char[] TYPE_REF= "typeRef/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] TYPE_DECL = "typeDecl/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] TYPE_ALL = "type".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] NAMESPACE_REF= "namespaceRef/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] NAMESPACE_DECL= "namespaceDecl/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] NAMESPACE_ALL = "namespace".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] FIELD_REF= "fieldRef/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] FIELD_DECL= "fieldDecl/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] FIELD_ALL= "field".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] ENUMTOR_REF= "enumtorRef/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] ENUMTOR_DECL = "enumtorDecl/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] ENUMTOR_ALL = "enumtor".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] METHOD_REF= "methodRef/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] METHOD_DECL= "methodDecl/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] METHOD_ALL= "method".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] MACRO_DECL = "macroDecl/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] MACRO_REF = "macroRef/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] INCLUDE_REF = "includeRef/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] FUNCTION_REF= "functionRef/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] FUNCTION_DECL= "functionDecl/".toCharArray(); //$NON-NLS-1$
|
||||
static public char[] FUNCTION_ALL= "function".toCharArray(); //$NON-NLS-1$
|
||||
|
||||
protected InMemoryIndex index;
|
||||
/**
|
||||
* IndexerOutput constructor comment.
|
||||
|
@ -26,17 +66,7 @@ public class IndexerOutput implements IIndexerOutput {
|
|||
this.index= index;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public void addRef(int indexedFileNumber, char[] word){
|
||||
addRef(indexedFileNumber,word,1,1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a reference to the given word to the inMemoryIndex.
|
||||
*/
|
||||
public void addRef(int indexedFileNumber, char[] word, int offset, int offsetLength, int offsetType) {
|
||||
protected void addRef(int indexedFileNumber, char [][] name, int type, LimitTo limit, int offset, int offsetLength, int offsetType) {
|
||||
if (indexedFileNumber == 0) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
@ -44,15 +74,25 @@ public class IndexerOutput implements IIndexerOutput {
|
|||
if (offsetLength <= 0)
|
||||
offsetLength = 1;
|
||||
|
||||
index.addRef(word, indexedFileNumber, offset, offsetLength, offsetType);
|
||||
index.addRef(
|
||||
encodeTypeEntry(name, type, limit),
|
||||
indexedFileNumber, offset, offsetLength, offsetType);
|
||||
}
|
||||
/**
|
||||
* Adds a reference to the given word to the inMemoryIndex.
|
||||
*/
|
||||
public void addRef(int indexedFileNumber, String word, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, word.toCharArray(), offset, offsetLength, offsetType);
|
||||
}
|
||||
|
||||
protected void addRef(int indexedFileNumber, char[][] name, char[] prefix, int prefixLength, int offset, int offsetLength, int offsetType) {
|
||||
if (indexedFileNumber == 0) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
if (offsetLength <= 0)
|
||||
offsetLength = 1;
|
||||
|
||||
index.addRef(
|
||||
encodeEntry(name, prefix, prefixLength),
|
||||
indexedFileNumber, offset, offsetLength, offsetType);
|
||||
|
||||
}
|
||||
|
||||
public void addRelatives(int indexedFileNumber, String inclusion, String parent) {
|
||||
if (indexedFileNumber == 0) {
|
||||
throw new IllegalStateException();
|
||||
|
@ -82,5 +122,579 @@ public class IndexerOutput implements IIndexerOutput {
|
|||
public IndexedFileEntry addIndexedFile(String path) {
|
||||
return index.addFile(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Type entries are encoded as follow: 'typeDecl/' ('C' | 'S' | 'U' | 'E' ) '/' TypeName ['/' Qualifier]*
|
||||
*/
|
||||
protected static final char[] encodeTypeEntry( char[][] fullTypeName, int typeType, LimitTo encodeType){
|
||||
|
||||
int pos = 0, nameLength = 0;
|
||||
for (int i=0; i<fullTypeName.length; i++){
|
||||
char[] namePart = fullTypeName[i];
|
||||
nameLength+= namePart.length;
|
||||
}
|
||||
|
||||
char [] result = null;
|
||||
if( encodeType == ICSearchConstants.REFERENCES ){
|
||||
//char[] has to be of size - [type decl length + length of the name + separators + letter]
|
||||
result = new char[TYPE_REF.length + nameLength + fullTypeName.length + 1 ];
|
||||
System.arraycopy(TYPE_REF, 0, result, 0, pos = TYPE_REF.length);
|
||||
|
||||
} else if( encodeType == ICSearchConstants.DECLARATIONS ){
|
||||
//char[] has to be of size - [type decl length + length of the name + separators + letter]
|
||||
result = new char[TYPE_DECL.length + nameLength + fullTypeName.length + 1 ];
|
||||
System.arraycopy(TYPE_DECL, 0, result, 0, pos = TYPE_DECL.length);
|
||||
}
|
||||
switch (typeType)
|
||||
{
|
||||
case(TYPE_CLASS):
|
||||
result[pos++] = CLASS_SUFFIX;
|
||||
break;
|
||||
|
||||
case(TYPE_STRUCT):
|
||||
result[pos++] = STRUCT_SUFFIX;
|
||||
break;
|
||||
|
||||
case(TYPE_UNION):
|
||||
result[pos++] = UNION_SUFFIX;
|
||||
break;
|
||||
|
||||
case(TYPE_ENUM):
|
||||
result[pos++] = ENUM_SUFFIX;
|
||||
break;
|
||||
|
||||
case (TYPE_VAR):
|
||||
result[pos++] = VAR_SUFFIX;
|
||||
break;
|
||||
|
||||
case (TYPE_TYPEDEF):
|
||||
result[pos++] = TYPEDEF_SUFFIX;
|
||||
break;
|
||||
|
||||
case(TYPE_DERIVED):
|
||||
result[pos++]= DERIVED_SUFFIX;
|
||||
break;
|
||||
|
||||
case(TYPE_FRIEND):
|
||||
result[pos++]= FRIEND_SUFFIX;
|
||||
break;
|
||||
|
||||
case(TYPE_FWD_CLASS):
|
||||
result[pos++]= FWD_CLASS_SUFFIX;
|
||||
break;
|
||||
|
||||
case (TYPE_FWD_STRUCT):
|
||||
result[pos++]= FWD_STRUCT_SUFFIX;
|
||||
break;
|
||||
|
||||
case (TYPE_FWD_UNION):
|
||||
result[pos++]= FWD_UNION_SUFFIX;
|
||||
break;
|
||||
}
|
||||
result[pos++] = SEPARATOR;
|
||||
//Encode in the following manner
|
||||
// [typeDecl info]/[typeName]/[qualifiers]
|
||||
if (fullTypeName.length > 0){
|
||||
//Extract the name first
|
||||
char [] tempName = fullTypeName[fullTypeName.length-1];
|
||||
System.arraycopy(tempName, 0, result, pos, tempName.length);
|
||||
pos += tempName.length;
|
||||
}
|
||||
//Extract the qualifiers
|
||||
for (int i=fullTypeName.length - 2; i >= 0; i--){
|
||||
result[pos++] = SEPARATOR;
|
||||
char [] tempName = fullTypeName[i];
|
||||
System.arraycopy(tempName, 0, result, pos, tempName.length);
|
||||
pos+=tempName.length;
|
||||
}
|
||||
|
||||
if (AbstractIndexer.VERBOSE)
|
||||
AbstractIndexer.verbose(new String(result));
|
||||
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Namespace entries are encoded as follow: '[prefix]/' TypeName ['/' Qualifier]*
|
||||
*/
|
||||
protected static final char[] encodeEntry(char[][] elementName, char[] prefix, int prefixSize){
|
||||
int pos, nameLength = 0;
|
||||
for (int i=0; i<elementName.length; i++){
|
||||
char[] namePart = elementName[i];
|
||||
nameLength+= namePart.length;
|
||||
}
|
||||
//char[] has to be of size - [type length + length of the name (including qualifiers) +
|
||||
//separators (need one less than fully qualified name length)
|
||||
char[] result = new char[prefixSize + nameLength + elementName.length - 1 ];
|
||||
System.arraycopy(prefix, 0, result, 0, pos = prefix.length);
|
||||
if (elementName.length > 0){
|
||||
//Extract the name first
|
||||
char [] tempName = elementName[elementName.length-1];
|
||||
System.arraycopy(tempName, 0, result, pos, tempName.length);
|
||||
pos += tempName.length;
|
||||
}
|
||||
//Extract the qualifiers
|
||||
for (int i=elementName.length - 2; i>=0; i--){
|
||||
result[pos++] = SEPARATOR;
|
||||
char [] tempName = elementName[i];
|
||||
System.arraycopy(tempName, 0, result, pos, tempName.length);
|
||||
pos+=tempName.length;
|
||||
}
|
||||
|
||||
if (AbstractIndexer.VERBOSE)
|
||||
AbstractIndexer.verbose(new String(result));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final char[] bestTypePrefix( SearchFor searchFor, LimitTo limitTo, char[] typeName, char[][] containingTypes, int matchMode, boolean isCaseSensitive) {
|
||||
char [] prefix = null;
|
||||
if( limitTo == DECLARATIONS ){
|
||||
prefix = TYPE_DECL;
|
||||
} else if( limitTo == REFERENCES ){
|
||||
prefix = TYPE_REF;
|
||||
} else {
|
||||
return TYPE_ALL;
|
||||
}
|
||||
|
||||
char classType = 0;
|
||||
|
||||
if( searchFor == ICSearchConstants.CLASS ){
|
||||
classType = CLASS_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.STRUCT ){
|
||||
classType = STRUCT_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.UNION ){
|
||||
classType = UNION_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.ENUM ){
|
||||
classType = ENUM_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.TYPEDEF ){
|
||||
classType = TYPEDEF_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.DERIVED){
|
||||
classType = DERIVED_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.FRIEND){
|
||||
classType = FRIEND_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.FWD_CLASS) {
|
||||
classType = FWD_CLASS_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.FWD_STRUCT) {
|
||||
classType = FWD_STRUCT_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.FWD_UNION) {
|
||||
classType = FWD_UNION_SUFFIX;
|
||||
} else {
|
||||
//could be TYPE or CLASS_STRUCT, best we can do for these is the prefix
|
||||
return prefix;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, classType, typeName, containingTypes, matchMode, isCaseSensitive );
|
||||
}
|
||||
|
||||
public static final char[] bestNamespacePrefix(LimitTo limitTo, char[] namespaceName, char[][] containingTypes, int matchMode, boolean isCaseSensitive) {
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = NAMESPACE_REF;
|
||||
} else if ( limitTo == DECLARATIONS ) {
|
||||
prefix = NAMESPACE_DECL;
|
||||
} else {
|
||||
return NAMESPACE_ALL;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, (char) 0, namespaceName, containingTypes, matchMode, isCaseSensitive );
|
||||
}
|
||||
|
||||
public static final char[] bestVariablePrefix( LimitTo limitTo, char[] varName, char[][] containingTypes, int matchMode, boolean isCaseSenstive ){
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = TYPE_REF;
|
||||
} else if( limitTo == DECLARATIONS ){
|
||||
prefix = TYPE_DECL;
|
||||
} else {
|
||||
return TYPE_ALL;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, VAR_SUFFIX, varName, containingTypes, matchMode, isCaseSenstive );
|
||||
}
|
||||
|
||||
public static final char[] bestFieldPrefix( LimitTo limitTo, char[] fieldName,char[][] containingTypes, int matchMode, boolean isCaseSensitive) {
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = FIELD_REF;
|
||||
} else if( limitTo == DECLARATIONS ){
|
||||
prefix = FIELD_DECL;
|
||||
} else {
|
||||
return FIELD_ALL;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, (char)0, fieldName, containingTypes, matchMode, isCaseSensitive );
|
||||
}
|
||||
|
||||
public static final char[] bestEnumeratorPrefix( LimitTo limitTo, char[] enumeratorName,char[][] containingTypes, int matchMode, boolean isCaseSensitive) {
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = ENUMTOR_REF;
|
||||
} else if( limitTo == DECLARATIONS ){
|
||||
prefix = ENUMTOR_DECL;
|
||||
} else if (limitTo == ALL_OCCURRENCES){
|
||||
return ENUMTOR_ALL;
|
||||
}
|
||||
else {
|
||||
//Definitions
|
||||
return "noEnumtorDefs".toCharArray(); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, (char)0, enumeratorName, containingTypes, matchMode, isCaseSensitive );
|
||||
}
|
||||
|
||||
public static final char[] bestMethodPrefix( LimitTo limitTo, char[] methodName,char[][] containingTypes, int matchMode, boolean isCaseSensitive) {
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = METHOD_REF;
|
||||
} else if( limitTo == DECLARATIONS ){
|
||||
prefix = METHOD_DECL;
|
||||
} else if( limitTo == DEFINITIONS ){
|
||||
//TODO prefix = METHOD_DEF;
|
||||
return METHOD_ALL;
|
||||
} else {
|
||||
return METHOD_ALL;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, (char)0, methodName, containingTypes, matchMode, isCaseSensitive );
|
||||
}
|
||||
|
||||
public static final char[] bestFunctionPrefix( LimitTo limitTo, char[] functionName, int matchMode, boolean isCaseSensitive) {
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = FUNCTION_REF;
|
||||
} else if( limitTo == DECLARATIONS ){
|
||||
prefix = FUNCTION_DECL;
|
||||
} else if ( limitTo == DEFINITIONS ){
|
||||
//TODO prefix = FUNCTION_DEF;
|
||||
return FUNCTION_ALL;
|
||||
} else {
|
||||
return FUNCTION_ALL;
|
||||
}
|
||||
return bestPrefix( prefix, (char)0, functionName, null, matchMode, isCaseSensitive );
|
||||
}
|
||||
|
||||
public static final char[] bestPrefix( char [] prefix, char optionalType, char[] name, char[][] containingTypes, int matchMode, boolean isCaseSensitive) {
|
||||
char[] result = null;
|
||||
int pos = 0;
|
||||
|
||||
int wildPos, starPos = -1, questionPos;
|
||||
|
||||
//length of prefix + separator
|
||||
int length = prefix.length;
|
||||
|
||||
//add length for optional type + another separator
|
||||
if( optionalType != 0 )
|
||||
length += 2;
|
||||
|
||||
if (!isCaseSensitive){
|
||||
//index is case sensitive, thus in case attempting case insensitive search, cannot consider
|
||||
//type name.
|
||||
name = null;
|
||||
} else if( matchMode == PATTERN_MATCH && name != null ){
|
||||
int start = 0;
|
||||
|
||||
char [] temp = new char [ name.length ];
|
||||
boolean isEscaped = false;
|
||||
int tmpIdx = 0;
|
||||
for( int i = 0; i < name.length; i++ ){
|
||||
if( name[i] == '\\' ){
|
||||
if( !isEscaped ){
|
||||
isEscaped = true;
|
||||
continue;
|
||||
}
|
||||
isEscaped = false;
|
||||
} else if( name[i] == '*' && !isEscaped ){
|
||||
starPos = i;
|
||||
break;
|
||||
}
|
||||
temp[ tmpIdx++ ] = name[i];
|
||||
}
|
||||
|
||||
name = new char [ tmpIdx ];
|
||||
System.arraycopy( temp, 0, name, 0, tmpIdx );
|
||||
|
||||
//starPos = CharOperation.indexOf( '*', name );
|
||||
questionPos = CharOperation.indexOf( '?', name );
|
||||
|
||||
if( starPos >= 0 ){
|
||||
if( questionPos >= 0 )
|
||||
wildPos = ( starPos < questionPos ) ? starPos : questionPos;
|
||||
else
|
||||
wildPos = starPos;
|
||||
} else {
|
||||
wildPos = questionPos;
|
||||
}
|
||||
|
||||
switch( wildPos ){
|
||||
case -1 : break;
|
||||
case 0 : name = null; break;
|
||||
default : name = CharOperation.subarray( name, 0, wildPos ); break;
|
||||
}
|
||||
}
|
||||
//add length for name
|
||||
if( name != null ){
|
||||
length += name.length;
|
||||
} else {
|
||||
//name is null, don't even consider qualifications.
|
||||
result = new char [ length ];
|
||||
System.arraycopy( prefix, 0, result, 0, pos = prefix.length );
|
||||
if( optionalType != 0){
|
||||
result[ pos++ ] = optionalType;
|
||||
result[ pos++ ] = SEPARATOR;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//add the total length of the qualifiers
|
||||
//we don't want to mess with the contents of this array (treat it as constant)
|
||||
//so check for wild cards later.
|
||||
if( containingTypes != null ){
|
||||
for( int i = 0; i < containingTypes.length; i++ ){
|
||||
if( containingTypes[i].length > 0 ){
|
||||
length += containingTypes[ i ].length;
|
||||
length++; //separator
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//because we haven't checked qualifier wild cards yet, this array might turn out
|
||||
//to be too long. So fill a temp array, then check the length after
|
||||
char [] temp = new char [ length ];
|
||||
|
||||
System.arraycopy( prefix, 0, temp, 0, pos = prefix.length );
|
||||
|
||||
if( optionalType != 0 ){
|
||||
temp[ pos++ ] = optionalType;
|
||||
temp[ pos++ ] = SEPARATOR;
|
||||
}
|
||||
|
||||
System.arraycopy( name, 0, temp, pos, name.length );
|
||||
pos += name.length;
|
||||
|
||||
if( containingTypes != null ){
|
||||
for( int i = containingTypes.length - 1; i >= 0; i-- ){
|
||||
if( matchMode == PATTERN_MATCH ){
|
||||
starPos = CharOperation.indexOf( '*', containingTypes[i] );
|
||||
questionPos = CharOperation.indexOf( '?', containingTypes[i] );
|
||||
|
||||
if( starPos >= 0 ){
|
||||
if( questionPos >= 0 )
|
||||
wildPos = ( starPos < questionPos ) ? starPos : questionPos;
|
||||
else
|
||||
wildPos = starPos;
|
||||
} else {
|
||||
wildPos = questionPos;
|
||||
}
|
||||
|
||||
if( wildPos >= 0 ){
|
||||
temp[ pos++ ] = SEPARATOR;
|
||||
System.arraycopy( containingTypes[i], 0, temp, pos, wildPos );
|
||||
pos += starPos;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( containingTypes[i].length > 0 ){
|
||||
temp[ pos++ ] = SEPARATOR;
|
||||
System.arraycopy( containingTypes[i], 0, temp, pos, containingTypes[i].length );
|
||||
pos += containingTypes[i].length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( pos < length ){
|
||||
result = new char[ pos ];
|
||||
System.arraycopy( temp, 0, result, 0, pos );
|
||||
} else {
|
||||
result = temp;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param _limitTo
|
||||
* @param simpleName
|
||||
* @param _matchMode
|
||||
* @param _caseSensitive
|
||||
* @return
|
||||
*/
|
||||
public static final char[] bestMacroPrefix( LimitTo limitTo, char[] macroName, int matchMode, boolean isCaseSenstive ){
|
||||
//since we only index macro declarations we already know the prefix
|
||||
char [] prefix = null;
|
||||
if( limitTo == DECLARATIONS ){
|
||||
prefix = MACRO_DECL;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, (char)0, macroName, null, matchMode, isCaseSenstive );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param _limitTo
|
||||
* @param simpleName
|
||||
* @param _matchMode
|
||||
* @param _caseSensitive
|
||||
* @return
|
||||
*/
|
||||
public static final char[] bestIncludePrefix( LimitTo limitTo, char[] incName, int matchMode, boolean isCaseSenstive ){
|
||||
//since we only index macro declarations we already know the prefix
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = INCLUDE_REF;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, (char)0, incName, null, matchMode, isCaseSenstive );
|
||||
}
|
||||
|
||||
public void addEnumtorDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ENUMTOR_DECL, ENUMTOR_DECL.length, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addEnumtorRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ENUMTOR_REF, ENUMTOR_REF.length, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addMacroDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, MACRO_DECL, MACRO_DECL.length, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addMacroRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, MACRO_REF, MACRO_REF.length, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFieldDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, FIELD_DECL, FIELD_DECL.length, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFieldRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, FIELD_REF, FIELD_REF.length, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addMethodDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, METHOD_DECL, METHOD_DECL.length, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addMethodRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, METHOD_REF, METHOD_REF.length, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFunctionDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, FUNCTION_DECL, FUNCTION_DECL.length, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFunctionRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, FUNCTION_REF, FUNCTION_REF.length, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addNamespaceDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, NAMESPACE_DECL, NAMESPACE_DECL.length, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addNamespaceRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, NAMESPACE_REF, NAMESPACE_REF.length, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addIncludeRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, INCLUDE_REF, INCLUDE_REF.length, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addStructDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_STRUCT , ICSearchConstants.DECLARATIONS, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addStructRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_STRUCT , ICSearchConstants.REFERENCES, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addTypedefDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_TYPEDEF, ICSearchConstants.DECLARATIONS, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addTypedefRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_TYPEDEF, ICSearchConstants.REFERENCES, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addUnionDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_UNION, ICSearchConstants.DECLARATIONS, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addUnionRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_UNION, ICSearchConstants.REFERENCES, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addVariableDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_VAR, ICSearchConstants.DECLARATIONS, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addVariableRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_VAR, ICSearchConstants.REFERENCES, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addClassDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_CLASS, ICSearchConstants.DECLARATIONS, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addClassRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_CLASS, ICSearchConstants.REFERENCES, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addEnumDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_ENUM, ICSearchConstants.DECLARATIONS, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addEnumRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_ENUM, ICSearchConstants.REFERENCES, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addDerivedDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_DERIVED, ICSearchConstants.DECLARATIONS, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addDerivedRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_DERIVED, ICSearchConstants.REFERENCES, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFriendDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_FRIEND, ICSearchConstants.DECLARATIONS, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFriendRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_FRIEND, ICSearchConstants.REFERENCES, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addVarDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_VAR, ICSearchConstants.DECLARATIONS, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addVarRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_VAR, ICSearchConstants.REFERENCES, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFwd_ClassDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_FWD_CLASS, ICSearchConstants.DECLARATIONS, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFwd_ClassRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_FWD_CLASS, ICSearchConstants.REFERENCES, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFwd_StructDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_FWD_STRUCT, ICSearchConstants.DECLARATIONS, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFwd_StructRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_FWD_STRUCT, ICSearchConstants.REFERENCES, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFwd_UnionDecl(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_FWD_UNION, ICSearchConstants.DECLARATIONS, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFwd_UnionRef(int indexedFileNumber, char[][] name, int offset, int offsetLength, int offsetType) {
|
||||
addRef(indexedFileNumber, name, ICIndexStorageConstants.TYPE_FWD_UNION, ICSearchConstants.REFERENCES, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,9 +16,6 @@ import org.eclipse.cdt.core.IConsoleParser;
|
|||
import org.eclipse.cdt.core.search.ICSearchConstants;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.ICIndexStorageConstants;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.index.domsourceindexer.IndexEncoderUtil;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexEncodingConstants;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexEncodingConstants.EntryType;
|
||||
|
||||
/**
|
||||
* @author Bogdan Gheorghe
|
||||
|
@ -76,7 +73,6 @@ public class CTagsConsoleParser implements IConsoleParser {
|
|||
* @param tempTag
|
||||
*/
|
||||
private void encodeTag(CTagEntry tempTag) {
|
||||
EntryType entryType = null;
|
||||
String kind = (String)tempTag.tagExtensionField.get(KIND);
|
||||
|
||||
if (kind == null)
|
||||
|
@ -84,40 +80,36 @@ public class CTagsConsoleParser implements IConsoleParser {
|
|||
|
||||
char[][] fullName = getQualifiedName(tempTag);
|
||||
ICSearchConstants.LimitTo type = ICSearchConstants.DECLARATIONS;
|
||||
int lineNumber = Integer.parseInt( (String)tempTag.tagExtensionField.get(LINE) );
|
||||
|
||||
if (kind.equals(CLASS)){
|
||||
entryType = IIndexEncodingConstants.CLASS;
|
||||
indexer.getOutput().addClassDecl(getFileNumber(), fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(MACRO)){
|
||||
entryType = IIndexEncodingConstants.MACRO;
|
||||
indexer.getOutput().addMacroDecl(getFileNumber(), fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(ENUMERATOR)){
|
||||
entryType = IIndexEncodingConstants.ENUMERATOR;
|
||||
indexer.getOutput().addEnumtorDecl(getFileNumber(), fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(FUNCTION)){
|
||||
entryType = IIndexEncodingConstants.FUNCTION;
|
||||
indexer.getOutput().addFunctionDecl(getFileNumber(), fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(ENUM)){
|
||||
entryType = IIndexEncodingConstants.ENUM;
|
||||
indexer.getOutput().addEnumDecl(getFileNumber(), fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(MEMBER)){
|
||||
entryType = IIndexEncodingConstants.FIELD;
|
||||
indexer.getOutput().addFieldDecl(getFileNumber(), fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(NAMESPACE)){
|
||||
entryType = IIndexEncodingConstants.NAMESPACE;
|
||||
indexer.getOutput().addNamespaceDecl(getFileNumber(), fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(PROTOTYPE)){
|
||||
entryType = IIndexEncodingConstants.FUNCTION;
|
||||
indexer.getOutput().addFunctionDecl(getFileNumber(), fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
//type = ICSearchConstants.DEFINITIONS;
|
||||
} else if (kind.equals(STRUCT)){
|
||||
entryType = IIndexEncodingConstants.STRUCT;
|
||||
indexer.getOutput().addStructDecl(getFileNumber(), fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(TYPEDEF)){
|
||||
entryType = IIndexEncodingConstants.TYPEDEF;
|
||||
indexer.getOutput().addTypedefDecl(getFileNumber(), fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(UNION)){
|
||||
entryType = IIndexEncodingConstants.UNION;
|
||||
indexer.getOutput().addUnionDecl(getFileNumber(), fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(VARIABLE)){
|
||||
entryType = IIndexEncodingConstants.VAR;
|
||||
indexer.getOutput().addVariableDecl(getFileNumber(), fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(EXTERNALVAR)){
|
||||
|
||||
}
|
||||
|
||||
String lineNumber = (String)tempTag.tagExtensionField.get(LINE);
|
||||
|
||||
if (entryType != null)
|
||||
indexer.getOutput().addRef(getFileNumber(),IndexEncoderUtil.encodeEntry(fullName,entryType,type), Integer.parseInt(lineNumber), 1, ICIndexStorageConstants.LINE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,16 +18,11 @@ import java.io.IOException;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants;
|
||||
import org.eclipse.cdt.internal.core.index.IIndex;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexer;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexerOutput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.ICIndexStorageConstants;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.index.domsourceindexer.IndexEncoderUtil;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexEncodingConstants;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexEncodingConstants.EntryType;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
||||
|
@ -97,7 +92,7 @@ public class CTagsFileReader {
|
|||
} catch (IOException e){}
|
||||
}
|
||||
|
||||
class MiniIndexer implements IIndexer, IIndexConstants {
|
||||
class MiniIndexer implements IIndexer {
|
||||
|
||||
IIndexerOutput output;
|
||||
IFile currentFile;
|
||||
|
@ -116,40 +111,35 @@ public class CTagsFileReader {
|
|||
if (mainIndexFile != null)
|
||||
fileNum = mainIndexFile.getFileID();
|
||||
|
||||
EntryType entryType = null;
|
||||
|
||||
ICSearchConstants.LimitTo type = ICSearchConstants.DECLARATIONS;
|
||||
|
||||
if (kind.equals(CTagsConsoleParser.CLASS)){
|
||||
entryType = IIndexEncodingConstants.CLASS;
|
||||
if (kind.equals(CTagsConsoleParser.CLASS)){
|
||||
output.addClassDecl(fileNum, fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(CTagsConsoleParser.MACRO)){
|
||||
entryType = IIndexEncodingConstants.MACRO;
|
||||
output.addMacroDecl(fileNum, fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(CTagsConsoleParser.ENUMERATOR)){
|
||||
entryType = IIndexEncodingConstants.ENUMERATOR;
|
||||
output.addEnumtorDecl(fileNum, fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(CTagsConsoleParser.FUNCTION)){
|
||||
entryType = IIndexEncodingConstants.FUNCTION;
|
||||
output.addFunctionDecl(fileNum, fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(CTagsConsoleParser.ENUM)){
|
||||
entryType = IIndexEncodingConstants.ENUM;
|
||||
output.addEnumDecl(fileNum, fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(CTagsConsoleParser.MEMBER)){
|
||||
entryType = IIndexEncodingConstants.FIELD;
|
||||
output.addFieldDecl(fileNum, fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(CTagsConsoleParser.NAMESPACE)){
|
||||
entryType = IIndexEncodingConstants.NAMESPACE;
|
||||
output.addNamespaceDecl(fileNum, fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(CTagsConsoleParser.PROTOTYPE)){
|
||||
entryType = IIndexEncodingConstants.FUNCTION;
|
||||
output.addFunctionDecl(fileNum, fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
//type = ICSearchConstants.DEFINITIONS;
|
||||
} else if (kind.equals(CTagsConsoleParser.STRUCT)){
|
||||
entryType = IIndexEncodingConstants.STRUCT;
|
||||
output.addStructDecl(fileNum, fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(CTagsConsoleParser.TYPEDEF)){
|
||||
entryType = IIndexEncodingConstants.TYPEDEF;
|
||||
output.addTypedefDecl(fileNum, fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(CTagsConsoleParser.UNION)){
|
||||
entryType = IIndexEncodingConstants.UNION;
|
||||
output.addUnionDecl(fileNum, fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(CTagsConsoleParser.VARIABLE)){
|
||||
entryType = IIndexEncodingConstants.VAR;
|
||||
output.addVariableDecl(fileNum, fullName, lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
} else if (kind.equals(CTagsConsoleParser.EXTERNALVAR)){
|
||||
|
||||
}
|
||||
|
||||
if (entryType != null)
|
||||
output.addRef(fileNum, IndexEncoderUtil.encodeEntry(fullName,entryType,type), lineNumber, 1, ICIndexStorageConstants.LINE);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.index.IIndexer#index(org.eclipse.cdt.internal.core.index.IDocument, org.eclipse.cdt.internal.core.index.IIndexerOutput)
|
||||
|
|
|
@ -29,10 +29,7 @@ import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
|||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||
import org.eclipse.cdt.core.dom.ast.IVariable;
|
||||
import org.eclipse.cdt.core.dom.ast.c.CASTVisitor;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.ICIndexStorageConstants;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexEncodingConstants;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexEncodingConstants.EntryType;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
||||
|
@ -96,7 +93,12 @@ public class CGenerateIndexVisitor extends CASTVisitor {
|
|||
* @throws DOMException
|
||||
*/
|
||||
private void processName(IASTName name) throws DOMException {
|
||||
IBinding binding = name.resolveBinding();
|
||||
// Quick check to see if the name is a reference in an external header file
|
||||
//if (IndexEncoderUtil.nodeInExternalHeader(name) && name.isReference())
|
||||
if (IndexEncoderUtil.nodeInExternalHeader(name))
|
||||
return;
|
||||
|
||||
IBinding binding = name.resolveBinding();
|
||||
// check for IProblemBinding
|
||||
if (binding instanceof IProblemBinding) {
|
||||
IProblemBinding problem = (IProblemBinding) binding;
|
||||
|
@ -107,6 +109,7 @@ public class CGenerateIndexVisitor extends CASTVisitor {
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the location
|
||||
IASTFileLocation loc = IndexEncoderUtil.getFileLocation(name);
|
||||
if (loc != null) {
|
||||
|
@ -140,59 +143,90 @@ public class CGenerateIndexVisitor extends CASTVisitor {
|
|||
* @param indexFlag
|
||||
* @throws DOMException
|
||||
*/
|
||||
|
||||
private void processNameBinding(IASTName name, IBinding binding, IASTFileLocation loc, int fileNumber) throws DOMException {
|
||||
// determine type
|
||||
EntryType entryType = null;
|
||||
if (binding instanceof ICompositeType) {
|
||||
int compositeKey = ((ICompositeType) binding).getKey();
|
||||
ASTNodeProperty prop = name.getPropertyInParent();
|
||||
switch (compositeKey) {
|
||||
case ICompositeType.k_struct:
|
||||
entryType = IIndexEncodingConstants.STRUCT;
|
||||
if (name.isDeclaration() && prop == IASTElaboratedTypeSpecifier.TYPE_NAME)
|
||||
entryType = IIndexEncodingConstants.FWD_STRUCT;
|
||||
if (name.isDeclaration()) {
|
||||
indexer.getOutput().addFwd_StructDecl(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (name.isReference()) {
|
||||
indexer.getOutput().addFwd_StructRef(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else
|
||||
if (name.isDeclaration()) {
|
||||
indexer.getOutput().addStructDecl(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (name.isReference()) {
|
||||
indexer.getOutput().addStructRef(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
break;
|
||||
case ICompositeType.k_union:
|
||||
entryType = IIndexEncodingConstants.UNION;
|
||||
case ICompositeType.k_union:
|
||||
if (name.isDeclaration() && prop == IASTElaboratedTypeSpecifier.TYPE_NAME)
|
||||
entryType = IIndexEncodingConstants.FWD_UNION;
|
||||
if (name.isDeclaration()) {
|
||||
indexer.getOutput().addFwd_UnionDecl(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (name.isReference()) {
|
||||
indexer.getOutput().addFwd_UnionRef(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else
|
||||
if (name.isDeclaration()) {
|
||||
indexer.getOutput().addUnionDecl(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (name.isReference()) {
|
||||
indexer.getOutput().addUnionRef(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (binding instanceof IEnumeration)
|
||||
entryType = IIndexEncodingConstants.ENUM;
|
||||
else if (binding instanceof ITypedef)
|
||||
entryType = IIndexEncodingConstants.TYPEDEF;
|
||||
else if (binding instanceof IEnumerator)
|
||||
entryType = IIndexEncodingConstants.ENUMERATOR;
|
||||
else if (binding instanceof IField)
|
||||
entryType = IIndexEncodingConstants.FIELD;
|
||||
else if (binding instanceof IParameter ||
|
||||
binding instanceof IVariable)
|
||||
entryType = IIndexEncodingConstants.VAR;
|
||||
else if (binding instanceof IFunction)
|
||||
entryType = IIndexEncodingConstants.FUNCTION;
|
||||
|
||||
if (entryType != null) {
|
||||
if (name.isDeclaration()) {
|
||||
indexer.getOutput().addRef(fileNumber,IndexEncoderUtil.encodeEntry(
|
||||
getFullyQualifiedName(name),
|
||||
entryType,
|
||||
ICSearchConstants.DECLARATIONS),
|
||||
loc.getNodeOffset(),
|
||||
loc.getNodeLength(),
|
||||
ICIndexStorageConstants.OFFSET);
|
||||
indexer.getOutput().addEnumDecl(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (name.isReference()) {
|
||||
indexer.getOutput().addRef(fileNumber, IndexEncoderUtil.encodeEntry(
|
||||
getFullyQualifiedName(name),
|
||||
entryType,
|
||||
ICSearchConstants.REFERENCES),
|
||||
loc.getNodeOffset(),
|
||||
loc.getNodeLength(),
|
||||
ICIndexStorageConstants.OFFSET);
|
||||
indexer.getOutput().addEnumRef(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (binding instanceof ITypedef)
|
||||
if (name.isDeclaration()) {
|
||||
indexer.getOutput().addTypedefDecl(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (name.isReference()) {
|
||||
indexer.getOutput().addTypedefRef(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (binding instanceof IEnumerator)
|
||||
if (name.isDeclaration()) {
|
||||
indexer.getOutput().addEnumtorDecl(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (name.isReference()) {
|
||||
indexer.getOutput().addEnumtorRef(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (binding instanceof IField)
|
||||
if (name.isDeclaration()) {
|
||||
indexer.getOutput().addFieldDecl(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (name.isReference()) {
|
||||
indexer.getOutput().addFieldRef(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (binding instanceof IParameter ||
|
||||
binding instanceof IVariable)
|
||||
if (name.isDeclaration()) {
|
||||
indexer.getOutput().addVarDecl(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (name.isReference()) {
|
||||
indexer.getOutput().addVarRef(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (binding instanceof IFunction)
|
||||
if (name.isDeclaration()) {
|
||||
indexer.getOutput().addFunctionDecl(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (name.isReference()) {
|
||||
indexer.getOutput().addFunctionRef(fileNumber, getFullyQualifiedName(name),loc.getNodeOffset(),loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,11 +37,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants.LimitTo;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.ICIndexStorageConstants;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexEncodingConstants;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexEncodingConstants.EntryType;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
||||
|
@ -127,7 +123,7 @@ public class CPPGenerateIndexVisitor extends CPPASTVisitor {
|
|||
//or if it occurs in another file
|
||||
int indexFlag = IndexEncoderUtil.calculateIndexFlags(indexer, loc);
|
||||
|
||||
processNameBinding(name, binding, loc, indexFlag, null); // function will determine limitTo
|
||||
processNameBinding(name, binding, loc, indexFlag); // function will determine Ref or Decl
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,62 +150,51 @@ public class CPPGenerateIndexVisitor extends CPPASTVisitor {
|
|||
* @param limitTo
|
||||
* @throws DOMException
|
||||
*/
|
||||
private void processNameBinding(IASTName name, IBinding binding, IASTFileLocation loc, int fileNumber, LimitTo limitTo) throws DOMException {
|
||||
// determine LimitTo
|
||||
if (limitTo == null) {
|
||||
if (name.isDeclaration()) {
|
||||
limitTo = ICSearchConstants.DECLARATIONS;
|
||||
}
|
||||
else if (name.isReference()) {
|
||||
limitTo = ICSearchConstants.REFERENCES;
|
||||
}
|
||||
else {
|
||||
limitTo = ICSearchConstants.UNKNOWN_LIMIT_TO;
|
||||
}
|
||||
}
|
||||
|
||||
// determine type
|
||||
EntryType entryType = null;
|
||||
if (binding instanceof ICompositeType) {
|
||||
|
||||
private void processNameDeclBinding(IASTName name, IBinding binding, IASTFileLocation loc, int fileNumber) throws DOMException {
|
||||
if (binding instanceof ICompositeType) {
|
||||
ICompositeType compBinding = (ICompositeType) binding;
|
||||
int compositeKey = compBinding.getKey();
|
||||
ASTNodeProperty prop = name.getPropertyInParent();
|
||||
switch (compositeKey) {
|
||||
case ICPPClassType.k_class:
|
||||
entryType = IIndexEncodingConstants.CLASS;
|
||||
case ICPPClassType.k_class:
|
||||
if (name.isDeclaration() && prop == IASTElaboratedTypeSpecifier.TYPE_NAME)
|
||||
entryType = IIndexEncodingConstants.FWD_CLASS;
|
||||
indexer.getOutput().addFwd_ClassDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else
|
||||
indexer.getOutput().addClassDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
break;
|
||||
case ICompositeType.k_struct:
|
||||
entryType = IIndexEncodingConstants.STRUCT;
|
||||
case ICompositeType.k_struct:
|
||||
if (name.isDeclaration() && prop == IASTElaboratedTypeSpecifier.TYPE_NAME)
|
||||
entryType = IIndexEncodingConstants.FWD_STRUCT;
|
||||
indexer.getOutput().addFwd_StructDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else
|
||||
indexer.getOutput().addStructDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
break;
|
||||
case ICompositeType.k_union:
|
||||
entryType = IIndexEncodingConstants.UNION;
|
||||
case ICompositeType.k_union:
|
||||
if (name.isDeclaration() && prop == IASTElaboratedTypeSpecifier.TYPE_NAME)
|
||||
entryType = IIndexEncodingConstants.FWD_UNION;
|
||||
indexer.getOutput().addFwd_UnionDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else
|
||||
indexer.getOutput().addUnionDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
break;
|
||||
}
|
||||
addDerivedAndFriendDeclaration(name, compBinding, loc, fileNumber);
|
||||
}
|
||||
else if (binding instanceof IEnumeration)
|
||||
entryType = IIndexEncodingConstants.ENUM;
|
||||
indexer.getOutput().addEnumDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof ITypedef)
|
||||
entryType = IIndexEncodingConstants.TYPEDEF;
|
||||
indexer.getOutput().addTypedefDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof ICPPNamespace)
|
||||
entryType = IIndexEncodingConstants.NAMESPACE;
|
||||
indexer.getOutput().addNamespaceDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof IEnumerator)
|
||||
entryType = IIndexEncodingConstants.ENUMERATOR;
|
||||
indexer.getOutput().addEnumtorDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof IField)
|
||||
entryType = IIndexEncodingConstants.FIELD;
|
||||
indexer.getOutput().addFieldDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof IParameter ||
|
||||
binding instanceof IVariable)
|
||||
entryType = IIndexEncodingConstants.VAR;
|
||||
indexer.getOutput().addVarDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof ICPPMethod)
|
||||
entryType = IIndexEncodingConstants.METHOD;
|
||||
indexer.getOutput().addMethodDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof IFunction) {
|
||||
entryType = IIndexEncodingConstants.FUNCTION;
|
||||
indexer.getOutput().addFunctionDecl(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
// TODO In case we want to add friend function declarations to index
|
||||
// addDerivedAndFriendDeclaration(name, binding, loc, fileNumber);
|
||||
}
|
||||
|
@ -217,21 +202,79 @@ public class CPPGenerateIndexVisitor extends CPPASTVisitor {
|
|||
ICPPDelegate[] delegates = ((ICPPUsingDeclaration)binding).getDelegates();
|
||||
for (int i = 0; i < delegates.length; i++) {
|
||||
IBinding orig = delegates[i].getBinding();
|
||||
processNameBinding(name, orig, loc, fileNumber, ICSearchConstants.REFERENCES); // reference to the original binding
|
||||
processNameBinding(name, delegates[i], loc, fileNumber, ICSearchConstants.DECLARATIONS); // declaration of the new name
|
||||
processNameRefBinding(name, orig, loc, fileNumber); // reference to the original binding
|
||||
processNameDeclBinding(name, delegates[i], loc, fileNumber); // declaration of the new name
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (entryType != null && limitTo != null) {
|
||||
indexer.getOutput().addRef(fileNumber, IndexEncoderUtil.encodeEntry(
|
||||
getFullyQualifiedName(binding),
|
||||
entryType,
|
||||
limitTo),
|
||||
loc.getNodeOffset(),
|
||||
loc.getNodeLength(),
|
||||
ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
private void processNameRefBinding(IASTName name, IBinding binding, IASTFileLocation loc, int fileNumber) throws DOMException {
|
||||
if (binding instanceof ICompositeType) {
|
||||
ICompositeType compBinding = (ICompositeType) binding;
|
||||
int compositeKey = compBinding.getKey();
|
||||
ASTNodeProperty prop = name.getPropertyInParent();
|
||||
switch (compositeKey) {
|
||||
case ICPPClassType.k_class:
|
||||
if (name.isDeclaration() && prop == IASTElaboratedTypeSpecifier.TYPE_NAME)
|
||||
indexer.getOutput().addFwd_ClassRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else
|
||||
indexer.getOutput().addClassRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
break;
|
||||
case ICompositeType.k_struct:
|
||||
if (name.isDeclaration() && prop == IASTElaboratedTypeSpecifier.TYPE_NAME)
|
||||
indexer.getOutput().addFwd_StructRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else
|
||||
indexer.getOutput().addStructRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
break;
|
||||
case ICompositeType.k_union:
|
||||
if (name.isDeclaration() && prop == IASTElaboratedTypeSpecifier.TYPE_NAME)
|
||||
indexer.getOutput().addFwd_UnionRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else
|
||||
indexer.getOutput().addUnionRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
break;
|
||||
}
|
||||
addDerivedAndFriendDeclaration(name, compBinding, loc, fileNumber);
|
||||
}
|
||||
else if (binding instanceof IEnumeration)
|
||||
indexer.getOutput().addEnumRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof ITypedef)
|
||||
indexer.getOutput().addTypedefRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof ICPPNamespace)
|
||||
indexer.getOutput().addNamespaceRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof IEnumerator)
|
||||
indexer.getOutput().addEnumtorRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof IField)
|
||||
indexer.getOutput().addFieldRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof IParameter ||
|
||||
binding instanceof IVariable)
|
||||
indexer.getOutput().addVarRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof ICPPMethod)
|
||||
indexer.getOutput().addMethodRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
else if (binding instanceof IFunction) {
|
||||
indexer.getOutput().addFunctionRef(fileNumber, getFullyQualifiedName(binding), loc.getNodeOffset(), loc.getNodeLength(),ICIndexStorageConstants.OFFSET);
|
||||
// TODO In case we want to add friend function declarations to index
|
||||
// addDerivedAndFriendDeclaration(name, binding, loc, fileNumber);
|
||||
}
|
||||
else if (binding instanceof ICPPUsingDeclaration) {
|
||||
ICPPDelegate[] delegates = ((ICPPUsingDeclaration)binding).getDelegates();
|
||||
for (int i = 0; i < delegates.length; i++) {
|
||||
IBinding orig = delegates[i].getBinding();
|
||||
processNameRefBinding(name, orig, loc, fileNumber); // reference to the original binding
|
||||
processNameDeclBinding(name, delegates[i], loc, fileNumber); // declaration of the new name
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
private void processNameBinding(IASTName name, IBinding binding, IASTFileLocation loc, int fileNumber) throws DOMException {
|
||||
if (name.isDeclaration()) {
|
||||
processNameDeclBinding(name, binding, loc, fileNumber);
|
||||
}
|
||||
else if (name.isReference()) {
|
||||
processNameRefBinding(name, binding, loc, fileNumber);
|
||||
}
|
||||
// else
|
||||
// ICSearchConstants.UNKNOWN_LIMIT_TO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -250,20 +293,16 @@ public class CPPGenerateIndexVisitor extends CPPASTVisitor {
|
|||
compositeKey == ICompositeType.k_struct) {
|
||||
if (prop == ICPPASTBaseSpecifier.NAME) {
|
||||
// base class
|
||||
indexer.getOutput().addRef(fileNumber, IndexEncoderUtil.encodeEntry(
|
||||
getFullyQualifiedName(binding),
|
||||
IIndexEncodingConstants.DERIVED,
|
||||
ICSearchConstants.DECLARATIONS),
|
||||
indexer.getOutput().addDerivedDecl(fileNumber,
|
||||
getFullyQualifiedName(binding),
|
||||
loc.getNodeOffset(),
|
||||
loc.getNodeLength(),
|
||||
ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (prop == IASTElaboratedTypeSpecifier.TYPE_NAME) {
|
||||
// friend
|
||||
indexer.getOutput().addRef(fileNumber, IndexEncoderUtil.encodeEntry(
|
||||
getFullyQualifiedName(binding),
|
||||
IIndexEncodingConstants.FRIEND,
|
||||
ICSearchConstants.DECLARATIONS),
|
||||
indexer.getOutput().addFriendDecl(fileNumber,
|
||||
getFullyQualifiedName(binding),
|
||||
loc.getNodeOffset(),
|
||||
loc.getNodeLength(),
|
||||
ICIndexStorageConstants.OFFSET);
|
||||
|
@ -285,7 +324,7 @@ public class CPPGenerateIndexVisitor extends CPPASTVisitor {
|
|||
// // friend
|
||||
// indexer.getOutput().addRef(fileNumber, IndexEncoderUtil.encodeEntry(
|
||||
// getFullyQualifiedName(binding),
|
||||
// IIndexEncodingConstants.FRIEND,
|
||||
// ICIndexStorageConstants.FRIEND,
|
||||
// ICSearchConstants.DECLARATIONS));
|
||||
// }
|
||||
// }
|
||||
|
|
|
@ -35,12 +35,10 @@ import org.eclipse.cdt.core.model.CoreModel;
|
|||
import org.eclipse.cdt.core.model.ICModelMarker;
|
||||
import org.eclipse.cdt.core.parser.ParseError;
|
||||
import org.eclipse.cdt.core.parser.ParserLanguage;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.ICIndexStorageConstants;
|
||||
import org.eclipse.cdt.internal.core.index.impl.IndexDelta;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.AbstractIndexer;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.SourceIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexEncodingConstants;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IMarker;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
|
@ -204,10 +202,10 @@ public class DOMSourceIndexerRunner extends AbstractIndexer {
|
|||
getOutput().addIncludeRef(fileNumber, include);
|
||||
getOutput().addRelatives(fileNumber, include,
|
||||
(parent != null) ? parent.getIncludeDirective().getPath() : null);
|
||||
getOutput().addRef(fileNumber, IndexEncoderUtil.encodeEntry(
|
||||
new char[][] {include.toCharArray()},
|
||||
IIndexEncodingConstants.INCLUDE,
|
||||
ICSearchConstants.REFERENCES));
|
||||
getOutput().addIncludeRef(fileNumber,
|
||||
new char[][] {include.toCharArray()},
|
||||
1,1, ICIndexStorageConstants.LINE
|
||||
);
|
||||
|
||||
/* See if this file has been encountered before */
|
||||
indexer.haveEncounteredHeader(resourceFile.getProject().getFullPath(), new Path(include));
|
||||
|
@ -226,10 +224,8 @@ public class DOMSourceIndexerRunner extends AbstractIndexer {
|
|||
// Get the location
|
||||
IASTFileLocation loc = IndexEncoderUtil.getFileLocation(macro);
|
||||
int fileNumber = IndexEncoderUtil.calculateIndexFlags(this, loc);
|
||||
getOutput().addRef(fileNumber, IndexEncoderUtil.encodeEntry(
|
||||
new char[][] {macro.toCharArray()},
|
||||
IIndexEncodingConstants.MACRO,
|
||||
ICSearchConstants.DECLARATIONS),
|
||||
getOutput().addMacroDecl(fileNumber,
|
||||
new char[][] {macro.toCharArray()},
|
||||
loc.getNodeOffset(),
|
||||
loc.getNodeLength(),
|
||||
ICIndexStorageConstants.OFFSET);
|
||||
|
|
|
@ -14,59 +14,11 @@ import org.eclipse.cdt.core.CCorePlugin;
|
|||
import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNodeLocation;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants.LimitTo;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.AbstractIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexEncodingConstants;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexEncodingConstants.EntryType;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
||||
public class IndexEncoderUtil {
|
||||
|
||||
public static final char[] encodeEntry(char[][] elementName, EntryType entryType, LimitTo encodeType) {
|
||||
// Temporarily
|
||||
if (elementName == null) {
|
||||
return "NPE".toCharArray(); //$NON-NLS-1$
|
||||
}
|
||||
int pos, nameLength = 0;
|
||||
for (int i=0; i < elementName.length; i++){
|
||||
char[] namePart = elementName[i];
|
||||
nameLength += namePart.length;
|
||||
}
|
||||
char[][] encodedTypeNames = null;
|
||||
if (encodeType == ICSearchConstants.DECLARATIONS) {
|
||||
encodedTypeNames = IIndexEncodingConstants.encodedTypeNames_Decl;
|
||||
}
|
||||
else if (encodeType == ICSearchConstants.REFERENCES) {
|
||||
encodedTypeNames = IIndexEncodingConstants.encodedTypeNames_Ref;
|
||||
}
|
||||
char[] encodedTypeName = encodedTypeNames[entryType.toInt()];
|
||||
|
||||
//char[] has to be of size - [type length + length of the name (including qualifiers) +
|
||||
//separators (need one less than fully qualified name length)
|
||||
char[] result = new char[encodedTypeName.length + nameLength + elementName.length - 1];
|
||||
System.arraycopy(encodedTypeName, 0, result, 0, pos = encodedTypeName.length);
|
||||
if (elementName.length > 0) {
|
||||
//Extract the name first
|
||||
char [] tempName = elementName[elementName.length-1];
|
||||
System.arraycopy(tempName, 0, result, pos, tempName.length);
|
||||
pos += tempName.length;
|
||||
}
|
||||
//Extract the qualifiers
|
||||
for (int i=elementName.length - 2; i>=0; i--){
|
||||
result[pos++] = IIndexEncodingConstants.SEPARATOR;
|
||||
char [] tempName = elementName[i];
|
||||
System.arraycopy(tempName, 0, result, pos, tempName.length);
|
||||
pos+=tempName.length;
|
||||
}
|
||||
|
||||
if (AbstractIndexer.VERBOSE)
|
||||
AbstractIndexer.verbose(new String(result));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int calculateIndexFlags(DOMSourceIndexerRunner indexer, IASTFileLocation loc) {
|
||||
int fileNum= 0;
|
||||
|
@ -132,5 +84,12 @@ public class IndexEncoderUtil {
|
|||
}
|
||||
return fileLoc;
|
||||
}
|
||||
|
||||
public static boolean nodeInExternalHeader(IASTNode node) {
|
||||
String fileName = node.getContainingFilename();
|
||||
return (CCorePlugin.getWorkspace().getRoot().getFileForLocation(new Path(fileName)) == null)
|
||||
? true : false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -23,11 +23,9 @@ import org.eclipse.cdt.core.filetype.ICFileType;
|
|||
import org.eclipse.cdt.core.filetype.ICFileTypeConstants;
|
||||
import org.eclipse.cdt.core.model.ICModelMarker;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants;
|
||||
import org.eclipse.cdt.internal.core.CharOperation;
|
||||
import org.eclipse.cdt.internal.core.Util;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexer;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexerOutput;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IMarker;
|
||||
|
@ -39,7 +37,7 @@ import org.eclipse.core.runtime.IStatus;
|
|||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
|
||||
public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSearchConstants {
|
||||
public abstract class AbstractIndexer implements IIndexer, ICSearchConstants {
|
||||
|
||||
public static boolean VERBOSE = false;
|
||||
public static boolean TIMING = false;
|
||||
|
@ -98,314 +96,6 @@ public abstract class AbstractIndexer implements IIndexer,IIndexConstants, ICSea
|
|||
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Type entries are encoded as follow: 'typeDecl/' ('C' | 'S' | 'U' ) '/' TypeName '/'
|
||||
* Current encoding is optimized for queries: all classes
|
||||
*/
|
||||
public static final char[] bestTypePrefix( SearchFor searchFor, LimitTo limitTo, char[] typeName, char[][] containingTypes, int matchMode, boolean isCaseSensitive) {
|
||||
char [] prefix = null;
|
||||
if( limitTo == DECLARATIONS ){
|
||||
prefix = TYPE_DECL;
|
||||
} else if( limitTo == REFERENCES ){
|
||||
prefix = TYPE_REF;
|
||||
} else {
|
||||
return TYPE_ALL;
|
||||
}
|
||||
|
||||
char classType = 0;
|
||||
|
||||
if( searchFor == ICSearchConstants.CLASS ){
|
||||
classType = CLASS_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.STRUCT ){
|
||||
classType = STRUCT_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.UNION ){
|
||||
classType = UNION_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.ENUM ){
|
||||
classType = ENUM_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.TYPEDEF ){
|
||||
classType = TYPEDEF_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.DERIVED){
|
||||
classType = DERIVED_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.FRIEND){
|
||||
classType = FRIEND_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.FWD_CLASS) {
|
||||
classType = FWD_CLASS_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.FWD_STRUCT) {
|
||||
classType = FWD_STRUCT_SUFFIX;
|
||||
} else if ( searchFor == ICSearchConstants.FWD_UNION) {
|
||||
classType = FWD_UNION_SUFFIX;
|
||||
} else {
|
||||
//could be TYPE or CLASS_STRUCT, best we can do for these is the prefix
|
||||
return prefix;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, classType, typeName, containingTypes, matchMode, isCaseSensitive );
|
||||
}
|
||||
|
||||
public static final char[] bestNamespacePrefix(LimitTo limitTo, char[] namespaceName, char[][] containingTypes, int matchMode, boolean isCaseSensitive) {
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = NAMESPACE_REF;
|
||||
} else if ( limitTo == DECLARATIONS ) {
|
||||
prefix = NAMESPACE_DECL;
|
||||
} else {
|
||||
return NAMESPACE_ALL;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, (char) 0, namespaceName, containingTypes, matchMode, isCaseSensitive );
|
||||
}
|
||||
|
||||
public static final char[] bestVariablePrefix( LimitTo limitTo, char[] varName, char[][] containingTypes, int matchMode, boolean isCaseSenstive ){
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = TYPE_REF;
|
||||
} else if( limitTo == DECLARATIONS ){
|
||||
prefix = TYPE_DECL;
|
||||
} else {
|
||||
return TYPE_ALL;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, VAR_SUFFIX, varName, containingTypes, matchMode, isCaseSenstive );
|
||||
}
|
||||
|
||||
public static final char[] bestFieldPrefix( LimitTo limitTo, char[] fieldName,char[][] containingTypes, int matchMode, boolean isCaseSensitive) {
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = FIELD_REF;
|
||||
} else if( limitTo == DECLARATIONS ){
|
||||
prefix = FIELD_DECL;
|
||||
} else {
|
||||
return FIELD_ALL;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, (char)0, fieldName, containingTypes, matchMode, isCaseSensitive );
|
||||
}
|
||||
|
||||
public static final char[] bestEnumeratorPrefix( LimitTo limitTo, char[] enumeratorName,char[][] containingTypes, int matchMode, boolean isCaseSensitive) {
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = ENUMTOR_REF;
|
||||
} else if( limitTo == DECLARATIONS ){
|
||||
prefix = ENUMTOR_DECL;
|
||||
} else if (limitTo == ALL_OCCURRENCES){
|
||||
return ENUMTOR_ALL;
|
||||
}
|
||||
else {
|
||||
//Definitions
|
||||
return "noEnumtorDefs".toCharArray(); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, (char)0, enumeratorName, containingTypes, matchMode, isCaseSensitive );
|
||||
}
|
||||
|
||||
public static final char[] bestMethodPrefix( LimitTo limitTo, char[] methodName,char[][] containingTypes, int matchMode, boolean isCaseSensitive) {
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = METHOD_REF;
|
||||
} else if( limitTo == DECLARATIONS ){
|
||||
prefix = METHOD_DECL;
|
||||
} else if( limitTo == DEFINITIONS ){
|
||||
//TODO prefix = METHOD_DEF;
|
||||
return METHOD_ALL;
|
||||
} else {
|
||||
return METHOD_ALL;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, (char)0, methodName, containingTypes, matchMode, isCaseSensitive );
|
||||
}
|
||||
|
||||
public static final char[] bestFunctionPrefix( LimitTo limitTo, char[] functionName, int matchMode, boolean isCaseSensitive) {
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = FUNCTION_REF;
|
||||
} else if( limitTo == DECLARATIONS ){
|
||||
prefix = FUNCTION_DECL;
|
||||
} else if ( limitTo == DEFINITIONS ){
|
||||
//TODO prefix = FUNCTION_DEF;
|
||||
return FUNCTION_ALL;
|
||||
} else {
|
||||
return FUNCTION_ALL;
|
||||
}
|
||||
return bestPrefix( prefix, (char)0, functionName, null, matchMode, isCaseSensitive );
|
||||
}
|
||||
|
||||
public static final char[] bestPrefix( char [] prefix, char optionalType, char[] name, char[][] containingTypes, int matchMode, boolean isCaseSensitive) {
|
||||
char[] result = null;
|
||||
int pos = 0;
|
||||
|
||||
int wildPos, starPos = -1, questionPos;
|
||||
|
||||
//length of prefix + separator
|
||||
int length = prefix.length;
|
||||
|
||||
//add length for optional type + another separator
|
||||
if( optionalType != 0 )
|
||||
length += 2;
|
||||
|
||||
if (!isCaseSensitive){
|
||||
//index is case sensitive, thus in case attempting case insensitive search, cannot consider
|
||||
//type name.
|
||||
name = null;
|
||||
} else if( matchMode == PATTERN_MATCH && name != null ){
|
||||
int start = 0;
|
||||
|
||||
char [] temp = new char [ name.length ];
|
||||
boolean isEscaped = false;
|
||||
int tmpIdx = 0;
|
||||
for( int i = 0; i < name.length; i++ ){
|
||||
if( name[i] == '\\' ){
|
||||
if( !isEscaped ){
|
||||
isEscaped = true;
|
||||
continue;
|
||||
}
|
||||
isEscaped = false;
|
||||
} else if( name[i] == '*' && !isEscaped ){
|
||||
starPos = i;
|
||||
break;
|
||||
}
|
||||
temp[ tmpIdx++ ] = name[i];
|
||||
}
|
||||
|
||||
name = new char [ tmpIdx ];
|
||||
System.arraycopy( temp, 0, name, 0, tmpIdx );
|
||||
|
||||
//starPos = CharOperation.indexOf( '*', name );
|
||||
questionPos = CharOperation.indexOf( '?', name );
|
||||
|
||||
if( starPos >= 0 ){
|
||||
if( questionPos >= 0 )
|
||||
wildPos = ( starPos < questionPos ) ? starPos : questionPos;
|
||||
else
|
||||
wildPos = starPos;
|
||||
} else {
|
||||
wildPos = questionPos;
|
||||
}
|
||||
|
||||
switch( wildPos ){
|
||||
case -1 : break;
|
||||
case 0 : name = null; break;
|
||||
default : name = CharOperation.subarray( name, 0, wildPos ); break;
|
||||
}
|
||||
}
|
||||
//add length for name
|
||||
if( name != null ){
|
||||
length += name.length;
|
||||
} else {
|
||||
//name is null, don't even consider qualifications.
|
||||
result = new char [ length ];
|
||||
System.arraycopy( prefix, 0, result, 0, pos = prefix.length );
|
||||
if( optionalType != 0){
|
||||
result[ pos++ ] = optionalType;
|
||||
result[ pos++ ] = SEPARATOR;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//add the total length of the qualifiers
|
||||
//we don't want to mess with the contents of this array (treat it as constant)
|
||||
//so check for wild cards later.
|
||||
if( containingTypes != null ){
|
||||
for( int i = 0; i < containingTypes.length; i++ ){
|
||||
if( containingTypes[i].length > 0 ){
|
||||
length += containingTypes[ i ].length;
|
||||
length++; //separator
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//because we haven't checked qualifier wild cards yet, this array might turn out
|
||||
//to be too long. So fill a temp array, then check the length after
|
||||
char [] temp = new char [ length ];
|
||||
|
||||
System.arraycopy( prefix, 0, temp, 0, pos = prefix.length );
|
||||
|
||||
if( optionalType != 0 ){
|
||||
temp[ pos++ ] = optionalType;
|
||||
temp[ pos++ ] = SEPARATOR;
|
||||
}
|
||||
|
||||
System.arraycopy( name, 0, temp, pos, name.length );
|
||||
pos += name.length;
|
||||
|
||||
if( containingTypes != null ){
|
||||
for( int i = containingTypes.length - 1; i >= 0; i-- ){
|
||||
if( matchMode == PATTERN_MATCH ){
|
||||
starPos = CharOperation.indexOf( '*', containingTypes[i] );
|
||||
questionPos = CharOperation.indexOf( '?', containingTypes[i] );
|
||||
|
||||
if( starPos >= 0 ){
|
||||
if( questionPos >= 0 )
|
||||
wildPos = ( starPos < questionPos ) ? starPos : questionPos;
|
||||
else
|
||||
wildPos = starPos;
|
||||
} else {
|
||||
wildPos = questionPos;
|
||||
}
|
||||
|
||||
if( wildPos >= 0 ){
|
||||
temp[ pos++ ] = SEPARATOR;
|
||||
System.arraycopy( containingTypes[i], 0, temp, pos, wildPos );
|
||||
pos += starPos;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( containingTypes[i].length > 0 ){
|
||||
temp[ pos++ ] = SEPARATOR;
|
||||
System.arraycopy( containingTypes[i], 0, temp, pos, containingTypes[i].length );
|
||||
pos += containingTypes[i].length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( pos < length ){
|
||||
result = new char[ pos ];
|
||||
System.arraycopy( temp, 0, result, 0, pos );
|
||||
} else {
|
||||
result = temp;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param _limitTo
|
||||
* @param simpleName
|
||||
* @param _matchMode
|
||||
* @param _caseSensitive
|
||||
* @return
|
||||
*/
|
||||
public static final char[] bestMacroPrefix( LimitTo limitTo, char[] macroName, int matchMode, boolean isCaseSenstive ){
|
||||
//since we only index macro declarations we already know the prefix
|
||||
char [] prefix = null;
|
||||
if( limitTo == DECLARATIONS ){
|
||||
prefix = MACRO_DECL;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, (char)0, macroName, null, matchMode, isCaseSenstive );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param _limitTo
|
||||
* @param simpleName
|
||||
* @param _matchMode
|
||||
* @param _caseSensitive
|
||||
* @return
|
||||
*/
|
||||
public static final char[] bestIncludePrefix( LimitTo limitTo, char[] incName, int matchMode, boolean isCaseSenstive ){
|
||||
//since we only index macro declarations we already know the prefix
|
||||
char [] prefix = null;
|
||||
if( limitTo == REFERENCES ){
|
||||
prefix = INCLUDE_REF;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return bestPrefix( prefix, (char)0, incName, null, matchMode, isCaseSenstive );
|
||||
}
|
||||
|
||||
|
||||
abstract private class Problem {
|
||||
public IFile file;
|
||||
|
|
|
@ -65,7 +65,6 @@ import org.eclipse.cdt.core.parser.ast.IASTUsingDirective;
|
|||
import org.eclipse.cdt.core.parser.ast.IASTVariable;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTVariableReference;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IndexProblemHandler;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
@ -80,7 +79,7 @@ import org.eclipse.core.runtime.Path;
|
|||
* To change the template for this generated type comment go to
|
||||
* Window>Preferences>Java>Code Generation>Code and Comments
|
||||
*/
|
||||
public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexConstants {
|
||||
public class SourceIndexerRequestor implements ISourceElementRequestor {
|
||||
|
||||
SourceIndexerRunner indexer;
|
||||
IFile resourceFile;
|
||||
|
@ -302,7 +301,12 @@ public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexCo
|
|||
else {
|
||||
//Need to add file to index and get a fileNumber
|
||||
if (tempFile != null){
|
||||
indFile = indexer.output.addIndexedFile(filePath);
|
||||
indFile = indexer.output.addIndexedFile(tempFile.getFullPath().toString());
|
||||
if (indFile != null)
|
||||
fileNum = indFile.getFileID();
|
||||
}
|
||||
else {
|
||||
indFile = indexer.output.addIndexedFile(include.getFullFileName());
|
||||
if (indFile != null)
|
||||
fileNum = indFile.getFileID();
|
||||
}
|
||||
|
|
|
@ -53,7 +53,6 @@ import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
|
|||
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTVariable;
|
||||
import org.eclipse.cdt.core.search.ICSearchConstants;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.ICIndexStorageConstants;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.index.impl.IndexDelta;
|
||||
|
@ -77,19 +76,6 @@ import org.eclipse.core.runtime.Path;
|
|||
* - Unions
|
||||
*/
|
||||
public class SourceIndexerRunner extends AbstractIndexer {
|
||||
|
||||
final static int CLASS = 1;
|
||||
final static int STRUCT = 2;
|
||||
final static int UNION = 3;
|
||||
final static int ENUM = 4;
|
||||
final static int VAR = 5;
|
||||
final static int TYPEDEF = 6;
|
||||
final static int DERIVED = 7;
|
||||
final static int FRIEND = 8;
|
||||
final static int FWD_CLASS = 9;
|
||||
final static int FWD_STRUCT = 10;
|
||||
final static int FWD_UNION = 11;
|
||||
|
||||
IFile resourceFile;
|
||||
private SourceIndexer indexer;
|
||||
|
||||
|
@ -277,7 +263,7 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
char[][] baseFullyQualifiedName = baseClassSpec.getFullyQualifiedNameCharArrays();
|
||||
int offset = baseClassSpec.getNameOffset();
|
||||
int offsetLength = baseClassSpec.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,DERIVED,ICSearchConstants.DECLARATIONS), offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addDerivedDecl(fileNumber, baseFullyQualifiedName, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
} catch (ASTNotImplementedException e) {}
|
||||
}
|
||||
|
@ -291,14 +277,14 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays();
|
||||
int offset = friendClassSpec.getNameOffset();
|
||||
int offsetLength = friendClassSpec.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,FRIEND,ICSearchConstants.DECLARATIONS),offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFriendDecl(fileNumber, baseFullyQualifiedName,offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (decl instanceof IASTElaboratedTypeSpecifier){
|
||||
IASTElaboratedTypeSpecifier friendClassSpec = (IASTElaboratedTypeSpecifier) decl;
|
||||
char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays();
|
||||
int offset = friendClassSpec.getNameOffset();
|
||||
int offsetLength = friendClassSpec.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,FRIEND,ICSearchConstants.DECLARATIONS), offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFriendDecl(fileNumber, baseFullyQualifiedName, offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (decl instanceof IASTFunction){
|
||||
|
||||
|
@ -311,7 +297,7 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
|
||||
int offset = classSpecification.getNameOffset();
|
||||
int offsetLength = classSpecification.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(classSpecification.getFullyQualifiedNameCharArrays(),CLASS, ICSearchConstants.DECLARATIONS),offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addClassDecl(fileNumber, classSpecification.getFullyQualifiedNameCharArrays(), offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (classSpecification.getClassKind().equals(ASTClassKind.STRUCT))
|
||||
{
|
||||
|
@ -326,7 +312,7 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
char[][] baseFullyQualifiedName = baseClassSpec.getFullyQualifiedNameCharArrays();
|
||||
int offset = baseClassSpec.getNameOffset();
|
||||
int offsetLength = baseClassSpec.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,DERIVED,ICSearchConstants.DECLARATIONS),offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addDerivedDecl(fileNumber, baseFullyQualifiedName, offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
} catch (ASTNotImplementedException e) {}
|
||||
}
|
||||
|
@ -340,14 +326,14 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays();
|
||||
int offset = friendClassSpec.getNameOffset();
|
||||
int offsetLength = friendClassSpec.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,FRIEND,ICSearchConstants.DECLARATIONS),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFriendDecl(fileNumber, baseFullyQualifiedName, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (decl instanceof IASTElaboratedTypeSpecifier){
|
||||
IASTElaboratedTypeSpecifier friendClassSpec = (IASTElaboratedTypeSpecifier) decl;
|
||||
char[][] baseFullyQualifiedName = friendClassSpec.getFullyQualifiedNameCharArrays();
|
||||
int offset = friendClassSpec.getNameOffset();
|
||||
int offsetLength = friendClassSpec.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(baseFullyQualifiedName,FRIEND,ICSearchConstants.DECLARATIONS),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFriendDecl(fileNumber, baseFullyQualifiedName, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (decl instanceof IASTFunction){
|
||||
|
||||
|
@ -359,13 +345,13 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
|
||||
int offset = classSpecification.getNameOffset();
|
||||
int offsetLength = classSpecification.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(classSpecification.getFullyQualifiedNameCharArrays(),STRUCT, ICSearchConstants.DECLARATIONS),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addStructDecl(fileNumber, classSpecification.getFullyQualifiedNameCharArrays(), offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (classSpecification.getClassKind().equals(ASTClassKind.UNION))
|
||||
{
|
||||
int offset = classSpecification.getNameOffset();
|
||||
int offsetLength = classSpecification.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(classSpecification.getFullyQualifiedNameCharArrays(),UNION, ICSearchConstants.DECLARATIONS),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addUnionDecl(fileNumber, classSpecification.getFullyQualifiedNameCharArrays(), offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -373,7 +359,7 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
|
||||
int offset = enumeration.getNameOffset();
|
||||
int offsetLength = enumeration.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(enumeration.getFullyQualifiedNameCharArrays(), ENUM, ICSearchConstants.DECLARATIONS),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addEnumDecl(fileNumber, enumeration.getFullyQualifiedNameCharArrays(), offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
|
||||
Iterator i = enumeration.getEnumerators();
|
||||
while (i.hasNext())
|
||||
|
@ -384,7 +370,7 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
|
||||
offset = en.getNameOffset();
|
||||
offsetLength = en.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeEntry( enumeratorFullName, ENUMTOR_DECL, ENUMTOR_DECL_LENGTH ),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addEnumtorDecl(fileNumber, enumeratorFullName, offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -406,61 +392,61 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
|
||||
int offset = enumerator.getNameOffset();
|
||||
int offsetLength = enumerator.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeEntry(createEnumeratorFullyQualifiedName(enumerator),ENUMTOR_REF,ENUMTOR_REF_LENGTH),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addEnumtorRef(fileNumber, createEnumeratorFullyQualifiedName(enumerator),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addMacro(IASTMacro macro, int fileNumber) {
|
||||
char[][] macroName = new char[][] { macro.getNameCharArray() };
|
||||
int offset = macro.getNameOffset();
|
||||
int offsetLength = macro.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeEntry(macroName,MACRO_DECL,MACRO_DECL_LENGTH), offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addMacroDecl(fileNumber, macroName, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addEnumerationReference(IASTEnumerationSpecifier enumeration, int fileNumber) {
|
||||
int offset = enumeration.getNameOffset();
|
||||
int offsetLength = enumeration.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(enumeration.getFullyQualifiedNameCharArrays(), ENUM, ICSearchConstants.REFERENCES), offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addEnumRef(fileNumber, enumeration.getFullyQualifiedNameCharArrays(), offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
public void addVariable(IASTVariable variable, int fileNumber) {
|
||||
int offset = variable.getNameOffset();
|
||||
int offsetLength = variable.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(variable.getFullyQualifiedNameCharArrays(), VAR, ICSearchConstants.DECLARATIONS), offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addVarDecl(fileNumber, variable.getFullyQualifiedNameCharArrays(), offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addVariableReference(IASTVariable variable, int fileNumber) {
|
||||
int offset = variable.getNameOffset();
|
||||
int offsetLength = variable.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(variable.getFullyQualifiedNameCharArrays(), VAR, ICSearchConstants.REFERENCES),offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addVarRef(fileNumber, variable.getFullyQualifiedNameCharArrays(), offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addParameterReference( IASTParameterDeclaration parameter, int fileNumber ){
|
||||
int offset = parameter.getNameOffset();
|
||||
int offsetLength = parameter.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber,encodeTypeEntry( new char[][] { parameter.getNameCharArray() }, VAR, ICSearchConstants.REFERENCES), offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addVarRef(fileNumber, new char[][] { parameter.getNameCharArray() }, offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addTypedefDeclaration(IASTTypedefDeclaration typedef, int fileNumber) {
|
||||
int offset = typedef.getNameOffset();
|
||||
int offsetLength = typedef.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber,encodeEntry(typedef.getFullyQualifiedNameCharArrays(), TYPEDEF_DECL, TYPEDEF_DECL_LENGTH),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addTypedefDecl(fileNumber,typedef.getFullyQualifiedNameCharArrays(),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFieldDeclaration(IASTField field, int fileNumber) {
|
||||
int offset = field.getNameOffset();
|
||||
int offsetLength = field.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeEntry(field.getFullyQualifiedNameCharArrays(),FIELD_DECL,FIELD_DECL_LENGTH),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFieldDecl(fileNumber, field.getFullyQualifiedNameCharArrays(),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addFieldReference(IASTField field, int fileNumber) {
|
||||
int offset = field.getNameOffset();
|
||||
int offsetLength = field.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeEntry(field.getFullyQualifiedNameCharArrays(),FIELD_REF,FIELD_REF_LENGTH),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFieldRef(fileNumber, field.getFullyQualifiedNameCharArrays(),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addMethodDeclaration(IASTMethod method, int fileNumber) {
|
||||
int offset = method.getNameOffset();
|
||||
int offsetLength = method.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeEntry(method.getFullyQualifiedNameCharArrays(),METHOD_DECL,METHOD_DECL_LENGTH),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addMethodDecl(fileNumber, method.getFullyQualifiedNameCharArrays(),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
|
||||
Iterator i=method.getParameters();
|
||||
while (i.hasNext()){
|
||||
|
@ -469,7 +455,7 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
IASTParameterDeclaration parmDecl = (IASTParameterDeclaration) parm;
|
||||
offset = parmDecl.getNameOffset();
|
||||
offsetLength = parmDecl.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(new char[][]{parmDecl.getNameCharArray()}, VAR, ICSearchConstants.DECLARATIONS),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addVarDecl(fileNumber, new char[][]{parmDecl.getNameCharArray()},offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -477,7 +463,7 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
public void addMethodReference(IASTMethod method, int fileNumber) {
|
||||
int offset = method.getNameOffset();
|
||||
int offsetLength = method.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeEntry(method.getFullyQualifiedNameCharArrays(),METHOD_REF,METHOD_REF_LENGTH),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addMethodRef(fileNumber, method.getFullyQualifiedNameCharArrays(),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addElaboratedForwardDeclaration(IASTElaboratedTypeSpecifier elaboratedType, int fileNumber) {
|
||||
|
@ -486,15 +472,15 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
|
||||
if (elaboratedType.getClassKind().equals(ASTClassKind.CLASS))
|
||||
{
|
||||
output.addRef(fileNumber,encodeTypeEntry(elaboratedType.getFullyQualifiedNameCharArrays(),FWD_CLASS, ICSearchConstants.DECLARATIONS),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFwd_ClassDecl(fileNumber,elaboratedType.getFullyQualifiedNameCharArrays(),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (elaboratedType.getClassKind().equals(ASTClassKind.STRUCT))
|
||||
{
|
||||
output.addRef(fileNumber,encodeTypeEntry(elaboratedType.getFullyQualifiedNameCharArrays(),FWD_STRUCT, ICSearchConstants.DECLARATIONS),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFwd_StructDecl(fileNumber,elaboratedType.getFullyQualifiedNameCharArrays(),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (elaboratedType.getClassKind().equals(ASTClassKind.UNION))
|
||||
{
|
||||
output.addRef(fileNumber,encodeTypeEntry(elaboratedType.getFullyQualifiedNameCharArrays(),FWD_UNION, ICSearchConstants.DECLARATIONS),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFwd_UnionDecl(fileNumber,elaboratedType.getFullyQualifiedNameCharArrays(),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -516,7 +502,7 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
int offset = function.getNameOffset();
|
||||
int offsetLength = function.getNameEndOffset() - offset;
|
||||
|
||||
output.addRef(fileNumber, encodeEntry(function.getFullyQualifiedNameCharArrays(),FUNCTION_DECL,FUNCTION_DECL_LENGTH),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFunctionDecl(fileNumber, function.getFullyQualifiedNameCharArrays(),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
|
||||
Iterator i=function.getParameters();
|
||||
while (i.hasNext()){
|
||||
|
@ -525,7 +511,7 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
IASTParameterDeclaration parmDecl = (IASTParameterDeclaration) parm;
|
||||
offset = parmDecl.getNameOffset();
|
||||
offsetLength = parmDecl.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeTypeEntry(new char[][]{parmDecl.getNameCharArray()}, VAR, ICSearchConstants.DECLARATIONS),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addVarDecl(fileNumber, new char[][]{parmDecl.getNameCharArray()},offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -533,7 +519,7 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
public void addFunctionReference(IASTFunction function, int fileNumber){
|
||||
int offset = function.getNameOffset();
|
||||
int offsetLength = function.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeEntry(function.getFullyQualifiedNameCharArrays(),FUNCTION_REF,FUNCTION_REF_LENGTH),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFunctionRef(fileNumber, function.getFullyQualifiedNameCharArrays(),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addNameReference(){
|
||||
|
@ -543,19 +529,19 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
public void addNamespaceDefinition(IASTNamespaceDefinition namespace, int fileNumber){
|
||||
int offset = namespace.getNameOffset();
|
||||
int offsetLength = namespace.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeEntry(namespace.getFullyQualifiedNameCharArrays(),NAMESPACE_DECL,NAMESPACE_DECL_LENGTH),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addNamespaceDecl(fileNumber, namespace.getFullyQualifiedNameCharArrays(),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addNamespaceReference(IASTNamespaceDefinition namespace, int fileNumber) {
|
||||
int offset = namespace.getNameOffset();
|
||||
int offsetLength = namespace.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber, encodeEntry(namespace.getFullyQualifiedNameCharArrays(),NAMESPACE_REF,NAMESPACE_REF_LENGTH),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addNamespaceRef(fileNumber, namespace.getFullyQualifiedNameCharArrays(),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
public void addTypedefReference( IASTTypedefDeclaration typedef, int fileNumber ){
|
||||
int offset = typedef.getNameOffset();
|
||||
int offsetLength = typedef.getNameEndOffset() - offset;
|
||||
output.addRef(fileNumber,encodeTypeEntry( typedef.getFullyQualifiedNameCharArrays(), TYPEDEF, ICSearchConstants.REFERENCES),offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addTypedefRef(fileNumber, typedef.getFullyQualifiedNameCharArrays(), offset, offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
private void addSuperTypeReference(int modifiers, char[] packageName, char[] typeName, char[][] enclosingTypeNames, char classOrInterface, char[] superTypeName, char superClassOrInterface){
|
||||
|
@ -588,15 +574,15 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
|
||||
if (classKind.equals(ASTClassKind.CLASS))
|
||||
{
|
||||
output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,CLASS, ICSearchConstants.REFERENCES),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addClassRef(fileNumber, fullyQualifiedName,offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (classKind.equals(ASTClassKind.STRUCT))
|
||||
{
|
||||
output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,STRUCT,ICSearchConstants.REFERENCES),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addStructRef(fileNumber, fullyQualifiedName,offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (classKind.equals(ASTClassKind.UNION))
|
||||
{
|
||||
output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,UNION,ICSearchConstants.REFERENCES),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addUnionRef(fileNumber, fullyQualifiedName,offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -618,15 +604,15 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
|
||||
if (classKind.equals(ASTClassKind.CLASS))
|
||||
{
|
||||
output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,FWD_CLASS, ICSearchConstants.REFERENCES),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFwd_ClassRef(fileNumber, fullyQualifiedName, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (classKind.equals(ASTClassKind.STRUCT))
|
||||
{
|
||||
output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,FWD_STRUCT,ICSearchConstants.REFERENCES),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFwd_StructRef(fileNumber, fullyQualifiedName, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
else if (classKind.equals(ASTClassKind.UNION))
|
||||
{
|
||||
output.addRef(fileNumber, encodeTypeEntry(fullyQualifiedName,FWD_UNION,ICSearchConstants.REFERENCES),offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
output.addFwd_UnionRef(fileNumber, fullyQualifiedName, offset,offsetLength, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -639,130 +625,6 @@ public class SourceIndexerRunner extends AbstractIndexer {
|
|||
incName[0] = inclusion.getFullFileName().toCharArray();
|
||||
//TODO: Kludge! Get rid of BOGUS entry - need to restructure Dep Tree to use reference indexes
|
||||
int BOGUS_ENTRY = 1;
|
||||
this.output.addRef(fileNumber, encodeEntry(incName, INCLUDE_REF, INCLUDE_REF_LENGTH),1,1, ICIndexStorageConstants.LINE);
|
||||
this.output.addIncludeRef(fileNumber, incName,1,1, ICIndexStorageConstants.OFFSET);
|
||||
}
|
||||
|
||||
/**
|
||||
* Type entries are encoded as follow: 'typeDecl/' ('C' | 'S' | 'U' | 'E' ) '/' TypeName ['/' Qualifier]*
|
||||
*/
|
||||
protected static final char[] encodeTypeEntry( char[][] fullTypeName, int typeType, LimitTo encodeType){
|
||||
|
||||
int pos = 0, nameLength = 0;
|
||||
for (int i=0; i<fullTypeName.length; i++){
|
||||
char[] namePart = fullTypeName[i];
|
||||
nameLength+= namePart.length;
|
||||
}
|
||||
|
||||
char [] result = null;
|
||||
if( encodeType == REFERENCES ){
|
||||
//char[] has to be of size - [type decl length + length of the name + separators + letter]
|
||||
result = new char[TYPE_REF_LENGTH + nameLength + fullTypeName.length + 1 ];
|
||||
System.arraycopy(TYPE_REF, 0, result, 0, pos = TYPE_REF_LENGTH);
|
||||
|
||||
} else if( encodeType == DECLARATIONS ){
|
||||
//char[] has to be of size - [type decl length + length of the name + separators + letter]
|
||||
result = new char[TYPE_DECL_LENGTH + nameLength + fullTypeName.length + 1 ];
|
||||
System.arraycopy(TYPE_DECL, 0, result, 0, pos = TYPE_DECL_LENGTH);
|
||||
}
|
||||
switch (typeType)
|
||||
{
|
||||
case(CLASS):
|
||||
result[pos++] = CLASS_SUFFIX;
|
||||
break;
|
||||
|
||||
case(STRUCT):
|
||||
result[pos++] = STRUCT_SUFFIX;
|
||||
break;
|
||||
|
||||
case(UNION):
|
||||
result[pos++] = UNION_SUFFIX;
|
||||
break;
|
||||
|
||||
case(ENUM):
|
||||
result[pos++] = ENUM_SUFFIX;
|
||||
break;
|
||||
|
||||
case (VAR):
|
||||
result[pos++] = VAR_SUFFIX;
|
||||
break;
|
||||
|
||||
case (TYPEDEF):
|
||||
result[pos++] = TYPEDEF_SUFFIX;
|
||||
break;
|
||||
|
||||
case(DERIVED):
|
||||
result[pos++]= DERIVED_SUFFIX;
|
||||
break;
|
||||
|
||||
case(FRIEND):
|
||||
result[pos++]=FRIEND_SUFFIX;
|
||||
break;
|
||||
|
||||
case(FWD_CLASS):
|
||||
result[pos++]=FWD_CLASS_SUFFIX;
|
||||
break;
|
||||
|
||||
case (FWD_STRUCT):
|
||||
result[pos++]=FWD_STRUCT_SUFFIX;
|
||||
break;
|
||||
|
||||
case (FWD_UNION):
|
||||
result[pos++]=FWD_UNION_SUFFIX;
|
||||
break;
|
||||
}
|
||||
result[pos++] = SEPARATOR;
|
||||
//Encode in the following manner
|
||||
// [typeDecl info]/[typeName]/[qualifiers]
|
||||
if (fullTypeName.length > 0){
|
||||
//Extract the name first
|
||||
char [] tempName = fullTypeName[fullTypeName.length-1];
|
||||
System.arraycopy(tempName, 0, result, pos, tempName.length);
|
||||
pos += tempName.length;
|
||||
}
|
||||
//Extract the qualifiers
|
||||
for (int i=fullTypeName.length - 2; i >= 0; i--){
|
||||
result[pos++] = SEPARATOR;
|
||||
char [] tempName = fullTypeName[i];
|
||||
System.arraycopy(tempName, 0, result, pos, tempName.length);
|
||||
pos+=tempName.length;
|
||||
}
|
||||
|
||||
if (AbstractIndexer.VERBOSE)
|
||||
AbstractIndexer.verbose(new String(result));
|
||||
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Namespace entries are encoded as follow: '[prefix]/' TypeName ['/' Qualifier]*
|
||||
*/
|
||||
protected static final char[] encodeEntry(char[][] elementName, char[] prefix, int prefixSize){
|
||||
int pos, nameLength = 0;
|
||||
for (int i=0; i<elementName.length; i++){
|
||||
char[] namePart = elementName[i];
|
||||
nameLength+= namePart.length;
|
||||
}
|
||||
//char[] has to be of size - [type length + length of the name (including qualifiers) +
|
||||
//separators (need one less than fully qualified name length)
|
||||
char[] result = new char[prefixSize + nameLength + elementName.length - 1 ];
|
||||
System.arraycopy(prefix, 0, result, 0, pos = prefix.length);
|
||||
if (elementName.length > 0){
|
||||
//Extract the name first
|
||||
char [] tempName = elementName[elementName.length-1];
|
||||
System.arraycopy(tempName, 0, result, pos, tempName.length);
|
||||
pos += tempName.length;
|
||||
}
|
||||
//Extract the qualifiers
|
||||
for (int i=elementName.length - 2; i>=0; i--){
|
||||
result[pos++] = SEPARATOR;
|
||||
char [] tempName = elementName[i];
|
||||
System.arraycopy(tempName, 0, result, pos, tempName.length);
|
||||
pos+=tempName.length;
|
||||
}
|
||||
|
||||
if (AbstractIndexer.VERBOSE)
|
||||
AbstractIndexer.verbose(new String(result));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,121 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2004 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.internal.core.search.indexing;
|
||||
/**
|
||||
* @author bgheorgh
|
||||
*/
|
||||
public interface IIndexConstants {
|
||||
|
||||
/* index encoding */
|
||||
char[] REF= "ref/".toCharArray(); //$NON-NLS-1$
|
||||
|
||||
char[] TYPE_REF= "typeRef/".toCharArray(); //$NON-NLS-1$
|
||||
int TYPE_REF_LENGTH = 8;
|
||||
|
||||
char[] TYPE_DECL = "typeDecl/".toCharArray(); //$NON-NLS-1$
|
||||
char[] TYPE_ALL = "type".toCharArray(); //$NON-NLS-1$
|
||||
int TYPE_DECL_LENGTH = 9;
|
||||
|
||||
char[] FUNCTION_REF= "functionRef/".toCharArray(); //$NON-NLS-1$
|
||||
int FUNCTION_REF_LENGTH=12;
|
||||
|
||||
char[] FUNCTION_DECL= "functionDecl/".toCharArray(); //$NON-NLS-1$
|
||||
char[] FUNCTION_ALL= "function".toCharArray(); //$NON-NLS-1$
|
||||
int FUNCTION_DECL_LENGTH = 13;
|
||||
|
||||
char[] CONSTRUCTOR_REF= "constructorRef/".toCharArray(); //$NON-NLS-1$
|
||||
char[] CONSTRUCTOR_DECL= "constructorDecl/".toCharArray(); //$NON-NLS-1$
|
||||
|
||||
char[] NAMESPACE_REF= "namespaceRef/".toCharArray(); //$NON-NLS-1$
|
||||
int NAMESPACE_REF_LENGTH=13;
|
||||
|
||||
char[] NAMESPACE_DECL= "namespaceDecl/".toCharArray(); //$NON-NLS-1$
|
||||
char[] NAMESPACE_ALL = "namespace".toCharArray(); //$NON-NLS-1$
|
||||
int NAMESPACE_DECL_LENGTH = 14;
|
||||
|
||||
|
||||
char[] FIELD_REF= "fieldRef/".toCharArray(); //$NON-NLS-1$
|
||||
int FIELD_REF_LENGTH=9;
|
||||
|
||||
char[] FIELD_DECL= "fieldDecl/".toCharArray(); //$NON-NLS-1$
|
||||
char[] FIELD_ALL= "field".toCharArray(); //$NON-NLS-1$
|
||||
int FIELD_DECL_LENGTH = 10;
|
||||
|
||||
char[] ENUMTOR_REF= "enumtorRef/".toCharArray(); //$NON-NLS-1$
|
||||
int ENUMTOR_REF_LENGTH=11;
|
||||
|
||||
char[] ENUMTOR_DECL = "enumtorDecl/".toCharArray(); //$NON-NLS-1$
|
||||
char[] ENUMTOR_ALL = "enumtor".toCharArray(); //$NON-NLS-1$
|
||||
int ENUMTOR_DECL_LENGTH = 12;
|
||||
|
||||
char[] METHOD_REF= "methodRef/".toCharArray(); //$NON-NLS-1$
|
||||
int METHOD_REF_LENGTH = 10;
|
||||
|
||||
char[] METHOD_DECL= "methodDecl/".toCharArray(); //$NON-NLS-1$
|
||||
char[] METHOD_ALL= "method".toCharArray(); //$NON-NLS-1$
|
||||
int METHOD_DECL_LENGTH = 11;
|
||||
|
||||
char[] TYPEDEF_DECL = "typeDecl/T/".toCharArray(); //$NON-NLS-1$
|
||||
int TYPEDEF_DECL_LENGTH = 11;
|
||||
|
||||
char[] MACRO_DECL = "macroDecl/".toCharArray(); //$NON-NLS-1$
|
||||
int MACRO_DECL_LENGTH = 10;
|
||||
|
||||
char[] INCLUDE_REF = "includeRef/".toCharArray(); //$NON-NLS-1$
|
||||
int INCLUDE_REF_LENGTH = 11;
|
||||
//a Var REF will be treated as a typeREF
|
||||
//char[] VAR_REF= "varRef/".toCharArray(); //$NON-NLS-1$
|
||||
|
||||
//a Struct REF will be treated as a typeREF
|
||||
//char[] STRUCT_REF= "structRef/".toCharArray(); //$NON-NLS-1$
|
||||
|
||||
//a Enum REF will be treated as a typeREF
|
||||
//char[] ENUM_REF= "enumRef/".toCharArray(); //$NON-NLS-1$
|
||||
|
||||
//a UNION REF will be treated as a typeREF
|
||||
//char[] UNION_REF= "unionRef/".toCharArray(); //$NON-NLS-1$
|
||||
|
||||
|
||||
char[] SUPER_REF = "superRef/".toCharArray(); //$NON-NLS-1$
|
||||
|
||||
char[] CLASS_DECL= "typeDecl/C/".toCharArray(); //$NON-NLS-1$
|
||||
char[] VAR_DECL= "typeDecl/V/".toCharArray(); //$NON-NLS-1$
|
||||
char[] STRUCT_DECL= "typeDecl/S/".toCharArray(); //$NON-NLS-1$
|
||||
char[] ENUM_DECL= "typeDecl/E/".toCharArray(); //$NON-NLS-1$
|
||||
char[] UNION_DECL= "typeDecl/U/".toCharArray(); //$NON-NLS-1$
|
||||
|
||||
char[] OBJECT = "Object".toCharArray(); //$NON-NLS-1$
|
||||
char[][] COUNTS=
|
||||
new char[][] { new char[] {'0'}, new char[] {'1'}, new char[] {'2'}, new char[] {'3'}, new char[] {'4'}, new char[] {'5'}, new char[] {'6'}, new char[] {'7'}, new char[] {'8'}, new char[] {'9'}
|
||||
};
|
||||
char CLASS_SUFFIX = 'C';
|
||||
char VAR_SUFFIX = 'V';
|
||||
char STRUCT_SUFFIX = 'S';
|
||||
char ENUM_SUFFIX = 'E';
|
||||
char UNION_SUFFIX = 'U';
|
||||
char TYPEDEF_SUFFIX = 'T';
|
||||
char DERIVED_SUFFIX = 'D';
|
||||
char FRIEND_SUFFIX = 'F';
|
||||
char FWD_CLASS_SUFFIX = 'G';
|
||||
char FWD_STRUCT_SUFFIX = 'H';
|
||||
char FWD_UNION_SUFFIX = 'I';
|
||||
|
||||
char TYPE_SUFFIX = 0;
|
||||
char SEPARATOR= '/';
|
||||
|
||||
char[] ONE_STAR = new char[] {'*'};
|
||||
char[][] ONE_STAR_CHAR = new char[][] {ONE_STAR};
|
||||
|
||||
// used as special marker for enclosing type name of local and anonymous classes
|
||||
char[] ONE_ZERO = new char[] {'0'};
|
||||
char[][] ONE_ZERO_CHAR = new char[][] {ONE_ZERO};
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
/***********************************************************************
|
||||
* Copyright (c) 2004 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
***********************************************************************/
|
||||
package org.eclipse.cdt.internal.core.search.indexing;
|
||||
|
||||
|
||||
public interface IIndexEncodingConstants {
|
||||
public class EntryType {
|
||||
public int toInt() {
|
||||
return type;
|
||||
}
|
||||
private EntryType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
private int type;
|
||||
|
||||
}
|
||||
// entry types
|
||||
final static EntryType CLASS = new EntryType(1);
|
||||
final static EntryType STRUCT = new EntryType(2);
|
||||
final static EntryType UNION = new EntryType(3);
|
||||
final static EntryType ENUM = new EntryType(4);
|
||||
final static EntryType VAR = new EntryType(5);
|
||||
final static EntryType TYPEDEF = new EntryType(6);
|
||||
final static EntryType DERIVED = new EntryType(7);
|
||||
final static EntryType FRIEND = new EntryType(8);
|
||||
final static EntryType FWD_CLASS = new EntryType(9);
|
||||
final static EntryType FWD_STRUCT = new EntryType(10);
|
||||
final static EntryType FWD_UNION = new EntryType(11);
|
||||
final static EntryType NAMESPACE = new EntryType(12);
|
||||
final static EntryType ENUMERATOR = new EntryType(13);
|
||||
final static EntryType FIELD = new EntryType(14);
|
||||
final static EntryType METHOD = new EntryType(15);
|
||||
final static EntryType FUNCTION = new EntryType(16);
|
||||
final static EntryType MACRO = new EntryType(17);
|
||||
final static EntryType INCLUDE = new EntryType(18);
|
||||
|
||||
final static char[][] encodedTypeNames_Decl = {
|
||||
new char[] {' '}, // not used
|
||||
"typeDecl/C/".toCharArray(), // CLASS //$NON-NLS-1$
|
||||
"typeDecl/S/".toCharArray(), // STRUCT //$NON-NLS-1$
|
||||
"typeDecl/U/".toCharArray(), // UNION //$NON-NLS-1$
|
||||
"typeDecl/E/".toCharArray(), // ENUM //$NON-NLS-1$
|
||||
"typeDecl/V/".toCharArray(), // VAR //$NON-NLS-1$
|
||||
"typeDecl/T/".toCharArray(), // TYPEDEF //$NON-NLS-1$
|
||||
"typeDecl/D/".toCharArray(), // DERIVED //$NON-NLS-1$
|
||||
"typeDecl/F/".toCharArray(), // FIREND //$NON-NLS-1$
|
||||
"typeDecl/G/".toCharArray(), // FWD_CLASS //$NON-NLS-1$
|
||||
"typeDecl/H/".toCharArray(), // FWD_STRUCT //$NON-NLS-1$
|
||||
"typeDecl/I/".toCharArray(), // FWD_UNION //$NON-NLS-1$
|
||||
"namespaceDecl/".toCharArray(), // NAMESPACE //$NON-NLS-1$
|
||||
"enumtorDecl/".toCharArray(), // ENUMERATOR //$NON-NLS-1$
|
||||
"fieldDecl/".toCharArray(), // FIELD //$NON-NLS-1$
|
||||
"methodDecl/".toCharArray(), // METHOD //$NON-NLS-1$
|
||||
"functionDecl/".toCharArray(), // FUNCTION //$NON-NLS-1$
|
||||
"macroDecl/".toCharArray(), // MACRO //$NON-NLS-1$
|
||||
"includeDecl/".toCharArray() // INCLUDE-unused //$NON-NLS-1$
|
||||
};
|
||||
|
||||
final static char[][] encodedTypeNames_Ref = {
|
||||
new char[] {' '}, // not used
|
||||
"typeRef/C/".toCharArray(), // CLASS //$NON-NLS-1$
|
||||
"typeRef/S/".toCharArray(), // STRUCT //$NON-NLS-1$
|
||||
"typeRef/U/".toCharArray(), // UNION //$NON-NLS-1$
|
||||
"typeRef/E/".toCharArray(), // ENUM //$NON-NLS-1$
|
||||
"typeRef/V/".toCharArray(), // VAR //$NON-NLS-1$
|
||||
"typeRef/T/".toCharArray(), // TYPEDEF //$NON-NLS-1$
|
||||
"typeRef/D/".toCharArray(), // DERIVED //$NON-NLS-1$
|
||||
"typeRef/F/".toCharArray(), // FIREND //$NON-NLS-1$
|
||||
"typeRef/G/".toCharArray(), // FWD_CLASS-unused //$NON-NLS-1$
|
||||
"typeRef/H/".toCharArray(), // FWD_STRUCT-unused //$NON-NLS-1$
|
||||
"typeRef/I/".toCharArray(), // FWD_UNION-unused //$NON-NLS-1$
|
||||
"namespaceRef/".toCharArray(), // NAMESPACE //$NON-NLS-1$
|
||||
"enumtorRef/".toCharArray(), // ENUMERATOR //$NON-NLS-1$
|
||||
"fieldRef/".toCharArray(), // FIELD //$NON-NLS-1$
|
||||
"methodRef/".toCharArray(), // METHOD //$NON-NLS-1$
|
||||
"functionRef/".toCharArray(), // FUNCTION //$NON-NLS-1$
|
||||
"macroRef/".toCharArray(), // MACRO-unused //$NON-NLS-1$
|
||||
"includeRef/".toCharArray() // INCLUDE //$NON-NLS-1$
|
||||
};
|
||||
|
||||
final static char SEPARATOR= '/';
|
||||
|
||||
}
|
|
@ -42,7 +42,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
|
|||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.Plugin;
|
||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||
|
||||
public class CoreModel {
|
||||
|
|
|
@ -48,14 +48,13 @@ import org.eclipse.cdt.internal.core.index.IIndex;
|
|||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.BlocksIndexInput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.IndexInput;
|
||||
import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.OperationCanceledException;
|
||||
|
||||
/**
|
||||
* @author aniefer
|
||||
*/
|
||||
public abstract class CSearchPattern implements ICSearchConstants, ICSearchPattern, IIndexConstants {
|
||||
public abstract class CSearchPattern implements ICSearchConstants, ICSearchPattern {
|
||||
|
||||
public static final int IMPOSSIBLE_MATCH = 0;
|
||||
public static final int POSSIBLE_MATCH = 1;
|
||||
|
|
|
@ -27,8 +27,8 @@ import org.eclipse.cdt.core.search.ICSearchScope;
|
|||
import org.eclipse.cdt.internal.core.CharOperation;
|
||||
import org.eclipse.cdt.internal.core.index.IEntryResult;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.IndexInput;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.AbstractIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor;
|
||||
|
||||
|
||||
|
@ -155,7 +155,7 @@ public class ClassDeclarationPattern extends CSearchPattern {
|
|||
|
||||
|
||||
public void feedIndexRequestor(IIndexSearchRequestor requestor, int detailLevel, int[] references,IndexInput input, ICSearchScope scope) throws IOException {
|
||||
boolean isClass = decodedType == CLASS_SUFFIX;
|
||||
boolean isClass = decodedType == IndexerOutput.CLASS_SUFFIX;
|
||||
for (int i = 0, max = references.length; i < max; i++) {
|
||||
IndexedFileEntry file = input.getIndexedFile(references[i]);
|
||||
String path;
|
||||
|
@ -180,12 +180,12 @@ public class ClassDeclarationPattern extends CSearchPattern {
|
|||
char[] word = entryResult.getWord();
|
||||
int size = word.length;
|
||||
|
||||
int firstSlash = CharOperation.indexOf( SEPARATOR, word, 0 );
|
||||
int firstSlash = CharOperation.indexOf( IndexerOutput.SEPARATOR, word, 0 );
|
||||
|
||||
this.decodedType = word[ firstSlash + 1 ];
|
||||
firstSlash += 2;
|
||||
|
||||
int slash = CharOperation.indexOf( SEPARATOR, word, firstSlash + 1 );
|
||||
int slash = CharOperation.indexOf( IndexerOutput.SEPARATOR, word, firstSlash + 1 );
|
||||
|
||||
this.decodedSimpleName = CharOperation.subarray( word, firstSlash + 1, slash );
|
||||
|
||||
|
@ -199,7 +199,7 @@ public class ClassDeclarationPattern extends CSearchPattern {
|
|||
}
|
||||
|
||||
public char[] indexEntryPrefix() {
|
||||
return AbstractIndexer.bestTypePrefix(
|
||||
return IndexerOutput.bestTypePrefix(
|
||||
searchFor,
|
||||
getLimitTo(),
|
||||
simpleName,
|
||||
|
@ -212,30 +212,30 @@ public class ClassDeclarationPattern extends CSearchPattern {
|
|||
protected boolean matchIndexEntry() {
|
||||
//check type matches
|
||||
if( classKind == null ){
|
||||
if( searchFor == TYPEDEF && decodedType != TYPEDEF_SUFFIX ){
|
||||
if( searchFor == TYPEDEF && decodedType != IndexerOutput.TYPEDEF_SUFFIX ){
|
||||
return false;
|
||||
}
|
||||
//don't match variable entries
|
||||
if( decodedType == VAR_SUFFIX ){
|
||||
if( decodedType == IndexerOutput.VAR_SUFFIX ){
|
||||
return false;
|
||||
}
|
||||
} else if( classKind == ASTClassKind.CLASS ) {
|
||||
if( decodedType != CLASS_SUFFIX &&
|
||||
decodedType != FWD_CLASS_SUFFIX){
|
||||
if( decodedType != IndexerOutput.CLASS_SUFFIX &&
|
||||
decodedType != IndexerOutput.FWD_CLASS_SUFFIX){
|
||||
return false;
|
||||
}
|
||||
} else if ( classKind == ASTClassKind.STRUCT ) {
|
||||
if( decodedType != STRUCT_SUFFIX &&
|
||||
decodedType != FWD_STRUCT_SUFFIX){
|
||||
if( decodedType != IndexerOutput.STRUCT_SUFFIX &&
|
||||
decodedType != IndexerOutput.FWD_STRUCT_SUFFIX){
|
||||
return false;
|
||||
}
|
||||
} else if ( classKind == ASTClassKind.UNION ) {
|
||||
if( decodedType != UNION_SUFFIX &&
|
||||
decodedType != FWD_UNION_SUFFIX){
|
||||
if( decodedType != IndexerOutput.UNION_SUFFIX &&
|
||||
decodedType != IndexerOutput.FWD_UNION_SUFFIX){
|
||||
return false;
|
||||
}
|
||||
} else if ( classKind == ASTClassKind.ENUM ) {
|
||||
if( decodedType != ENUM_SUFFIX ) {
|
||||
if( decodedType != IndexerOutput.ENUM_SUFFIX ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
|
|||
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.AbstractIndexer;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
|
||||
/**
|
||||
* @author bgheorgh
|
||||
|
@ -46,7 +46,7 @@ public class DerivedTypesPattern extends ClassDeclarationPattern {
|
|||
}
|
||||
|
||||
public char[] indexEntryPrefix() {
|
||||
return AbstractIndexer.bestTypePrefix(
|
||||
return IndexerOutput.bestTypePrefix(
|
||||
searchFor,
|
||||
getLimitTo(),
|
||||
simpleName,
|
||||
|
@ -57,7 +57,7 @@ public class DerivedTypesPattern extends ClassDeclarationPattern {
|
|||
}
|
||||
|
||||
protected boolean matchIndexEntry() {
|
||||
if( decodedType != DERIVED_SUFFIX ){
|
||||
if( decodedType != IndexerOutput.DERIVED_SUFFIX ){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ import org.eclipse.cdt.core.search.ICSearchScope;
|
|||
import org.eclipse.cdt.internal.core.CharOperation;
|
||||
import org.eclipse.cdt.internal.core.index.IEntryResult;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.IndexInput;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.AbstractIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor;
|
||||
|
||||
|
||||
|
@ -108,15 +108,15 @@ public class FieldDeclarationPattern extends CSearchPattern {
|
|||
|
||||
public char[] indexEntryPrefix() {
|
||||
if( searchFor == FIELD ){
|
||||
return AbstractIndexer.bestFieldPrefix( _limitTo, simpleName, qualifications, _matchMode, _caseSensitive );
|
||||
return IndexerOutput.bestFieldPrefix( _limitTo, simpleName, qualifications, _matchMode, _caseSensitive );
|
||||
} else if( searchFor == VAR ) {
|
||||
return AbstractIndexer.bestVariablePrefix(
|
||||
return IndexerOutput.bestVariablePrefix(
|
||||
_limitTo,
|
||||
simpleName, qualifications,
|
||||
_matchMode, _caseSensitive
|
||||
);
|
||||
} else if (searchFor == ENUMTOR) {
|
||||
return AbstractIndexer.bestEnumeratorPrefix(_limitTo, simpleName, qualifications, _matchMode, _caseSensitive );
|
||||
return IndexerOutput.bestEnumeratorPrefix(_limitTo, simpleName, qualifications, _matchMode, _caseSensitive );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -133,15 +133,15 @@ public class FieldDeclarationPattern extends CSearchPattern {
|
|||
int slash = 0;
|
||||
|
||||
if( searchFor == FIELD ){
|
||||
firstSlash = CharOperation.indexOf( SEPARATOR, word, 0 );
|
||||
slash = CharOperation.indexOf(SEPARATOR, word, firstSlash + 1);
|
||||
firstSlash = CharOperation.indexOf( IndexerOutput.SEPARATOR, word, 0 );
|
||||
slash = CharOperation.indexOf(IndexerOutput.SEPARATOR, word, firstSlash + 1);
|
||||
} else if( searchFor == VAR ) {
|
||||
int realStart = CharOperation.indexOf( SEPARATOR, word, 0 );
|
||||
firstSlash = CharOperation.indexOf( SEPARATOR, word, realStart + 1);
|
||||
slash = CharOperation.indexOf(SEPARATOR, word, firstSlash + 1);
|
||||
int realStart = CharOperation.indexOf( IndexerOutput.SEPARATOR, word, 0 );
|
||||
firstSlash = CharOperation.indexOf( IndexerOutput.SEPARATOR, word, realStart + 1);
|
||||
slash = CharOperation.indexOf(IndexerOutput.SEPARATOR, word, firstSlash + 1);
|
||||
} else if ( searchFor == ENUMTOR ){
|
||||
firstSlash = CharOperation.indexOf( SEPARATOR, word, 0 );
|
||||
slash = CharOperation.indexOf(SEPARATOR, word, firstSlash + 1);
|
||||
firstSlash = CharOperation.indexOf( IndexerOutput.SEPARATOR, word, 0 );
|
||||
slash = CharOperation.indexOf(IndexerOutput.SEPARATOR, word, firstSlash + 1);
|
||||
}
|
||||
|
||||
this.decodedSimpleName = CharOperation.subarray(word, firstSlash + 1, slash);
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.Iterator;
|
|||
import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.AbstractIndexer;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
|
||||
/**
|
||||
* @author bgheorgh
|
||||
|
@ -45,7 +45,7 @@ public class FriendPattern extends ClassDeclarationPattern {
|
|||
}
|
||||
|
||||
public char[] indexEntryPrefix() {
|
||||
return AbstractIndexer.bestTypePrefix(
|
||||
return IndexerOutput.bestTypePrefix(
|
||||
searchFor,
|
||||
getLimitTo(),
|
||||
simpleName,
|
||||
|
@ -56,7 +56,7 @@ public class FriendPattern extends ClassDeclarationPattern {
|
|||
}
|
||||
|
||||
protected boolean matchIndexEntry() {
|
||||
if( decodedType != FRIEND_SUFFIX ){
|
||||
if( decodedType != IndexerOutput.FRIEND_SUFFIX ){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ import org.eclipse.cdt.core.search.ICSearchScope;
|
|||
import org.eclipse.cdt.internal.core.CharOperation;
|
||||
import org.eclipse.cdt.internal.core.index.IEntryResult;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.IndexInput;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.AbstractIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor;
|
||||
|
||||
/**
|
||||
|
@ -43,7 +43,7 @@ public class IncludePattern extends CSearchPattern {
|
|||
protected void decodeIndexEntry(IEntryResult entryResult) {
|
||||
char[] word = entryResult.getWord();
|
||||
|
||||
int firstSlash = CharOperation.indexOf( SEPARATOR, word, 0 );
|
||||
int firstSlash = CharOperation.indexOf( IndexerOutput.SEPARATOR, word, 0 );
|
||||
|
||||
this.decodedSimpleName = CharOperation.subarray(word, firstSlash + 1, -1);
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public class IncludePattern extends CSearchPattern {
|
|||
* @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#indexEntryPrefix()
|
||||
*/
|
||||
public char[] indexEntryPrefix() {
|
||||
return AbstractIndexer.bestIncludePrefix(
|
||||
return IndexerOutput.bestIncludePrefix(
|
||||
_limitTo,
|
||||
simpleName,
|
||||
_matchMode, _caseSensitive
|
||||
|
|
|
@ -22,8 +22,8 @@ import org.eclipse.cdt.core.search.ICSearchScope;
|
|||
import org.eclipse.cdt.internal.core.CharOperation;
|
||||
import org.eclipse.cdt.internal.core.index.IEntryResult;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.IndexInput;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.AbstractIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor;
|
||||
|
||||
/**
|
||||
|
@ -87,7 +87,7 @@ public class MacroDeclarationPattern extends CSearchPattern {
|
|||
protected void decodeIndexEntry(IEntryResult entryResult) {
|
||||
char[] word = entryResult.getWord();
|
||||
|
||||
int firstSlash = CharOperation.indexOf( SEPARATOR, word, 0 );
|
||||
int firstSlash = CharOperation.indexOf( IndexerOutput.SEPARATOR, word, 0 );
|
||||
|
||||
this.decodedSimpleName = CharOperation.subarray(word, firstSlash + 1, -1);
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ public class MacroDeclarationPattern extends CSearchPattern {
|
|||
* @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#indexEntryPrefix()
|
||||
*/
|
||||
public char[] indexEntryPrefix() {
|
||||
return AbstractIndexer.bestMacroPrefix(
|
||||
return IndexerOutput.bestMacroPrefix(
|
||||
_limitTo,
|
||||
simpleName,
|
||||
_matchMode, _caseSensitive
|
||||
|
|
|
@ -24,8 +24,8 @@ import org.eclipse.cdt.core.search.ICSearchScope;
|
|||
import org.eclipse.cdt.internal.core.CharOperation;
|
||||
import org.eclipse.cdt.internal.core.index.IEntryResult;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.IndexInput;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.AbstractIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor;
|
||||
|
||||
/**
|
||||
|
@ -123,9 +123,9 @@ public class MethodDeclarationPattern extends CSearchPattern {
|
|||
|
||||
public char[] indexEntryPrefix() {
|
||||
if( searchFor == FUNCTION )
|
||||
return AbstractIndexer.bestFunctionPrefix( _limitTo, simpleName, _matchMode, _caseSensitive );
|
||||
return IndexerOutput.bestFunctionPrefix( _limitTo, simpleName, _matchMode, _caseSensitive );
|
||||
else if( searchFor == METHOD )
|
||||
return AbstractIndexer.bestMethodPrefix( _limitTo, simpleName, qualifications, _matchMode, _caseSensitive );
|
||||
return IndexerOutput.bestMethodPrefix( _limitTo, simpleName, qualifications, _matchMode, _caseSensitive );
|
||||
else return null;
|
||||
}
|
||||
|
||||
|
@ -138,9 +138,9 @@ public class MethodDeclarationPattern extends CSearchPattern {
|
|||
char[] word = entryResult.getWord();
|
||||
int size = word.length;
|
||||
|
||||
int firstSlash = CharOperation.indexOf( SEPARATOR, word, 0 );
|
||||
int firstSlash = CharOperation.indexOf( IndexerOutput.SEPARATOR, word, 0 );
|
||||
|
||||
int slash = CharOperation.indexOf( SEPARATOR, word, firstSlash + 1 );
|
||||
int slash = CharOperation.indexOf( IndexerOutput.SEPARATOR, word, firstSlash + 1 );
|
||||
|
||||
this.decodedSimpleName = CharOperation.subarray(word, firstSlash + 1, slash);
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ import org.eclipse.cdt.core.search.ICSearchScope;
|
|||
import org.eclipse.cdt.internal.core.CharOperation;
|
||||
import org.eclipse.cdt.internal.core.index.IEntryResult;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.IndexInput;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.AbstractIndexer;
|
||||
import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor;
|
||||
|
||||
/**
|
||||
|
@ -101,9 +101,9 @@ public class NamespaceDeclarationPattern extends CSearchPattern {
|
|||
char[] word = entryResult.getWord();
|
||||
int size = word.length;
|
||||
|
||||
int firstSlash = CharOperation.indexOf( SEPARATOR, word, 0 );
|
||||
int firstSlash = CharOperation.indexOf( IndexerOutput.SEPARATOR, word, 0 );
|
||||
|
||||
int slash = CharOperation.indexOf(SEPARATOR, word, firstSlash + 1);
|
||||
int slash = CharOperation.indexOf(IndexerOutput.SEPARATOR, word, firstSlash + 1);
|
||||
|
||||
this.decodedSimpleName = CharOperation.subarray(word, firstSlash+1, slash);
|
||||
|
||||
|
@ -121,7 +121,7 @@ public class NamespaceDeclarationPattern extends CSearchPattern {
|
|||
* @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#indexEntryPrefix()
|
||||
*/
|
||||
public char[] indexEntryPrefix() {
|
||||
return AbstractIndexer.bestNamespacePrefix(
|
||||
return IndexerOutput.bestNamespacePrefix(
|
||||
_limitTo,
|
||||
simpleName,
|
||||
qualifications,
|
||||
|
|
|
@ -1086,7 +1086,7 @@ public class DOMAST extends ViewPart {
|
|||
protected void displayNames(IASTName[] names, String queryLabel, String pattern) {
|
||||
DOMQuery job = new DOMQuery(names, queryLabel, pattern);
|
||||
NewSearchUI.activateSearchResultView();
|
||||
NewSearchUI.runQuery(job);
|
||||
NewSearchUI.runQueryInBackground(job);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1096,7 +1096,7 @@ public class DOMAST extends ViewPart {
|
|||
protected void displayProblems(IASTProblem[] problems, String queryLabel, String pattern) {
|
||||
DOMQuery job = new DOMQuery(problems, queryLabel, pattern);
|
||||
NewSearchUI.activateSearchResultView();
|
||||
NewSearchUI.runQuery(job);
|
||||
NewSearchUI.runQueryInBackground(job);
|
||||
}
|
||||
|
||||
public void run() {
|
||||
|
|
|
@ -135,7 +135,7 @@ public class DOMQuery extends CSearchQuery implements ISearchQuery {
|
|||
*/
|
||||
public boolean canRunInBackground() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -15,7 +15,7 @@ import java.util.HashSet;
|
|||
import java.util.Set;
|
||||
|
||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.cdt.ui.browser.typeinfo.TypeInfoMessages;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
|
@ -66,63 +66,63 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
|
||||
private String message = "Filter Indexer Results (. = any character, .* = any string):"; //$NON-NLS-1$
|
||||
|
||||
public static final int ENTRY_REF = 1;
|
||||
public static final String ENTRY_REF_STRING = String.valueOf(IIndexConstants.REF);
|
||||
//public static final int ENTRY_REF = 1;
|
||||
//public static final String ENTRY_REF_STRING = String.valueOf(IndexerOutput.REF);
|
||||
public static final int ENTRY_TYPE_REF = 2;
|
||||
public static final String ENTRY_TYPE_REF_STRING = String.valueOf(IIndexConstants.TYPE_REF);
|
||||
public static final String ENTRY_TYPE_DECL_STRING = String.valueOf(IIndexConstants.TYPE_DECL);
|
||||
public static final String ENTRY_TYPE_REF_STRING = String.valueOf(IndexerOutput.TYPE_REF);
|
||||
public static final String ENTRY_TYPE_DECL_STRING = String.valueOf(IndexerOutput.TYPE_DECL);
|
||||
public static final int ENTRY_FUNCTION_REF = 4;
|
||||
public static final String ENTRY_FUNCTION_REF_STRING = String.valueOf(IIndexConstants.FUNCTION_REF);
|
||||
public static final String ENTRY_FUNCTION_REF_STRING = String.valueOf(IndexerOutput.FUNCTION_REF);
|
||||
public static final int ENTRY_FUNCTION_DECL = 5;
|
||||
public static final String ENTRY_FUNCTION_DECL_STRING = String.valueOf(IIndexConstants.FUNCTION_DECL);
|
||||
public static final String ENTRY_FUNCTION_DECL_STRING = String.valueOf(IndexerOutput.FUNCTION_DECL);
|
||||
public static final int ENTRY_CONSTRUCTOR_REF = 6;
|
||||
public static final String ENTRY_CONSTRUCTOR_REF_STRING = String.valueOf(IIndexConstants.CONSTRUCTOR_REF);
|
||||
public static final int ENTRY_CONSTRUCTOR_DECL = 7;
|
||||
public static final String ENTRY_CONSTRUCTOR_DECL_STRING = String.valueOf(IIndexConstants.CONSTRUCTOR_DECL);
|
||||
//public static final String ENTRY_CONSTRUCTOR_REF_STRING = String.valueOf(IndexerOutput.CONSTRUCTOR_REF);
|
||||
//public static final int ENTRY_CONSTRUCTOR_DECL = 7;
|
||||
//public static final String ENTRY_CONSTRUCTOR_DECL_STRING = String.valueOf(IndexerOutput.CONSTRUCTOR_DECL);
|
||||
public static final int ENTRY_NAMESPACE_REF = 8;
|
||||
public static final String ENTRY_NAMESPACE_REF_STRING = String.valueOf(IIndexConstants.NAMESPACE_REF);
|
||||
public static final String ENTRY_NAMESPACE_REF_STRING = String.valueOf(IndexerOutput.NAMESPACE_REF);
|
||||
public static final int ENTRY_NAMESPACE_DECL = 9;
|
||||
public static final String ENTRY_NAMESPACE_DECL_STRING = String.valueOf(IIndexConstants.NAMESPACE_DECL);
|
||||
public static final String ENTRY_NAMESPACE_DECL_STRING = String.valueOf(IndexerOutput.NAMESPACE_DECL);
|
||||
public static final int ENTRY_FIELD_REF = 10;
|
||||
public static final String ENTRY_FIELD_REF_STRING = String.valueOf(IIndexConstants.FIELD_REF);
|
||||
public static final String ENTRY_FIELD_REF_STRING = String.valueOf(IndexerOutput.FIELD_REF);
|
||||
public static final int ENTRY_FIELD_DECL = 11;
|
||||
public static final String ENTRY_FIELD_DECL_STRING = String.valueOf(IIndexConstants.FIELD_DECL);
|
||||
public static final String ENTRY_FIELD_DECL_STRING = String.valueOf(IndexerOutput.FIELD_DECL);
|
||||
public static final int ENTRY_ENUMTOR_REF = 12;
|
||||
public static final String ENTRY_ENUMTOR_REF_STRING = String.valueOf(IIndexConstants.ENUMTOR_REF);
|
||||
public static final String ENTRY_ENUMTOR_REF_STRING = String.valueOf(IndexerOutput.ENUMTOR_REF);
|
||||
public static final int ENTRY_ENUMTOR_DECL = 13;
|
||||
public static final String ENTRY_ENUMTOR_DECL_STRING = String.valueOf(IIndexConstants.ENUMTOR_DECL);
|
||||
public static final String ENTRY_ENUMTOR_DECL_STRING = String.valueOf(IndexerOutput.ENUMTOR_DECL);
|
||||
public static final int ENTRY_METHOD_REF = 14;
|
||||
public static final String ENTRY_METHOD_REF_STRING = String.valueOf(IIndexConstants.METHOD_REF);
|
||||
public static final String ENTRY_METHOD_REF_STRING = String.valueOf(IndexerOutput.METHOD_REF);
|
||||
public static final int ENTRY_METHOD_DECL = 15;
|
||||
public static final String ENTRY_METHOD_DECL_STRING = String.valueOf(IIndexConstants.METHOD_DECL);
|
||||
public static final String ENTRY_METHOD_DECL_STRING = String.valueOf(IndexerOutput.METHOD_DECL);
|
||||
public static final int ENTRY_MACRO_DECL = 16;
|
||||
public static final String ENTRY_MACRO_DECL_STRING = String.valueOf(IIndexConstants.MACRO_DECL);
|
||||
public static final String ENTRY_MACRO_DECL_STRING = String.valueOf(IndexerOutput.MACRO_DECL);
|
||||
public static final int ENTRY_INCLUDE_REF = 17;
|
||||
public static final String ENTRY_INCLUDE_REF_STRING = String.valueOf(IIndexConstants.INCLUDE_REF);
|
||||
public static final int ENTRY_SUPER_REF = 18;
|
||||
public static final String ENTRY_SUPER_REF_STRING = String.valueOf(IIndexConstants.SUPER_REF);
|
||||
public static final String ENTRY_INCLUDE_REF_STRING = String.valueOf(IndexerOutput.INCLUDE_REF);
|
||||
//public static final int ENTRY_SUPER_REF = 18;
|
||||
//public static final String ENTRY_SUPER_REF_STRING = String.valueOf(IndexerOutput.SUPER_REF);
|
||||
public static final int ENTRY_TYPE_DECL_T = 19;
|
||||
public static final String ENTRY_TYPE_DECL_T_STRING = String.valueOf(IIndexConstants.TYPEDEF_DECL);
|
||||
public static final String ENTRY_TYPE_DECL_T_STRING = String.valueOf(IndexerOutput.TYPE_DECL) + String.valueOf(IndexerOutput.TYPEDEF_SUFFIX) + String.valueOf(IndexerOutput.SEPARATOR);
|
||||
public static final int ENTRY_TYPE_DECL_C = 20;
|
||||
public static final String ENTRY_TYPE_DECL_C_STRING = String.valueOf(IIndexConstants.CLASS_DECL);
|
||||
public static final String ENTRY_TYPE_DECL_C_STRING = String.valueOf(IndexerOutput.TYPE_DECL) + String.valueOf(IndexerOutput.CLASS_SUFFIX) + String.valueOf(IndexerOutput.SEPARATOR);
|
||||
public static final int ENTRY_TYPE_DECL_V = 21;
|
||||
public static final String ENTRY_TYPE_DECL_V_STRING = String.valueOf(IIndexConstants.VAR_DECL);
|
||||
public static final String ENTRY_TYPE_DECL_V_STRING = String.valueOf(IndexerOutput.TYPE_DECL) + String.valueOf(IndexerOutput.VAR_SUFFIX) + String.valueOf(IndexerOutput.SEPARATOR);
|
||||
public static final int ENTRY_TYPE_DECL_S = 22;
|
||||
public static final String ENTRY_TYPE_DECL_S_STRING = String.valueOf(IIndexConstants.STRUCT_DECL);
|
||||
public static final String ENTRY_TYPE_DECL_S_STRING = String.valueOf(IndexerOutput.TYPE_DECL) + String.valueOf(IndexerOutput.STRUCT_SUFFIX) + String.valueOf(IndexerOutput.SEPARATOR);
|
||||
public static final int ENTRY_TYPE_DECL_E = 23;
|
||||
public static final String ENTRY_TYPE_DECL_E_STRING = String.valueOf(IIndexConstants.ENUM_DECL);
|
||||
public static final String ENTRY_TYPE_DECL_E_STRING = String.valueOf(IndexerOutput.TYPE_DECL) + String.valueOf(IndexerOutput.ENUM_SUFFIX) + String.valueOf(IndexerOutput.SEPARATOR);
|
||||
public static final int ENTRY_TYPE_DECL_U = 24;
|
||||
public static final String ENTRY_TYPE_DECL_U_STRING = String.valueOf(IIndexConstants.UNION_DECL);
|
||||
public static final String ENTRY_TYPE_DECL_U_STRING = String.valueOf(IndexerOutput.TYPE_DECL) + String.valueOf(IndexerOutput.UNION_SUFFIX) + String.valueOf(IndexerOutput.SEPARATOR);
|
||||
public static final int ENTRY_TYPE_DECL_D = 25;
|
||||
public static final String ENTRY_TYPE_DECL_D_STRING = String.valueOf(IIndexConstants.TYPE_DECL) + String.valueOf(IIndexConstants.DERIVED_SUFFIX) + String.valueOf(IIndexConstants.SEPARATOR);
|
||||
public static final String ENTRY_TYPE_DECL_D_STRING = String.valueOf(IndexerOutput.TYPE_DECL) + String.valueOf(IndexerOutput.DERIVED_SUFFIX) + String.valueOf(IndexerOutput.SEPARATOR);
|
||||
public static final int ENTRY_TYPE_DECL_F = 26;
|
||||
public static final String ENTRY_TYPE_DECL_F_STRING = String.valueOf(IIndexConstants.TYPE_DECL) + String.valueOf(IIndexConstants.FRIEND_SUFFIX) + String.valueOf(IIndexConstants.SEPARATOR);
|
||||
public static final String ENTRY_TYPE_DECL_F_STRING = String.valueOf(IndexerOutput.TYPE_DECL) + String.valueOf(IndexerOutput.FRIEND_SUFFIX) + String.valueOf(IndexerOutput.SEPARATOR);
|
||||
public static final int ENTRY_TYPE_DECL_G = 27;
|
||||
public static final String ENTRY_TYPE_DECL_G_STRING = String.valueOf(IIndexConstants.TYPE_DECL) + String.valueOf(IIndexConstants.FWD_CLASS_SUFFIX) + String.valueOf(IIndexConstants.SEPARATOR);
|
||||
public static final String ENTRY_TYPE_DECL_G_STRING = String.valueOf(IndexerOutput.TYPE_DECL) + String.valueOf(IndexerOutput.FWD_CLASS_SUFFIX) + String.valueOf(IndexerOutput.SEPARATOR);
|
||||
public static final int ENTRY_TYPE_DECL_H = 28;
|
||||
public static final String ENTRY_TYPE_DECL_H_STRING = String.valueOf(IIndexConstants.TYPE_DECL) + String.valueOf(IIndexConstants.FWD_STRUCT_SUFFIX) + String.valueOf(IIndexConstants.SEPARATOR);
|
||||
public static final String ENTRY_TYPE_DECL_H_STRING = String.valueOf(IndexerOutput.TYPE_DECL) + String.valueOf(IndexerOutput.FWD_STRUCT_SUFFIX) + String.valueOf(IndexerOutput.SEPARATOR);
|
||||
public static final int ENTRY_TYPE_DECL_I = 29;
|
||||
public static final String ENTRY_TYPE_DECL_I_STRING = String.valueOf(IIndexConstants.TYPE_DECL) + String.valueOf(IIndexConstants.FWD_UNION_SUFFIX) + String.valueOf(IIndexConstants.SEPARATOR);
|
||||
public static final String ENTRY_TYPE_DECL_I_STRING = String.valueOf(IndexerOutput.TYPE_DECL) + String.valueOf(IndexerOutput.FWD_UNION_SUFFIX) + String.valueOf(IndexerOutput.SEPARATOR);
|
||||
|
||||
private String fDialogSection;
|
||||
|
||||
|
@ -141,9 +141,9 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
|
||||
// this also determines the order that the buttons are displayed
|
||||
private static final int[] fAllTypes = { // ENTRY_TYPE_DECL,
|
||||
ENTRY_REF, ENTRY_SUPER_REF, ENTRY_MACRO_DECL,
|
||||
ENTRY_FUNCTION_DECL, ENTRY_NAMESPACE_DECL, ENTRY_CONSTRUCTOR_DECL,
|
||||
ENTRY_FUNCTION_REF, ENTRY_NAMESPACE_REF, ENTRY_CONSTRUCTOR_REF,
|
||||
/*ENTRY_REF,*/ /*ENTRY_SUPER_REF,*/ ENTRY_MACRO_DECL,
|
||||
ENTRY_FUNCTION_DECL, ENTRY_NAMESPACE_DECL, /*ENTRY_CONSTRUCTOR_DECL,*/
|
||||
ENTRY_FUNCTION_REF, ENTRY_NAMESPACE_REF, /*ENTRY_CONSTRUCTOR_REF,*/
|
||||
ENTRY_FIELD_DECL, ENTRY_ENUMTOR_DECL, ENTRY_METHOD_DECL,
|
||||
ENTRY_FIELD_REF, ENTRY_ENUMTOR_REF, ENTRY_METHOD_REF,
|
||||
ENTRY_TYPE_REF, ENTRY_TYPE_DECL_T, ENTRY_TYPE_DECL_C,
|
||||
|
@ -256,9 +256,9 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
String name;
|
||||
int type = typeObject.intValue();
|
||||
switch (type) {
|
||||
case ENTRY_REF:
|
||||
/* case ENTRY_REF:
|
||||
name = ENTRY_REF_STRING;
|
||||
break;
|
||||
break;*/
|
||||
case ENTRY_TYPE_REF:
|
||||
name = ENTRY_TYPE_REF_STRING;
|
||||
break;
|
||||
|
@ -271,12 +271,12 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
case ENTRY_FUNCTION_DECL:
|
||||
name = ENTRY_FUNCTION_DECL_STRING;
|
||||
break;
|
||||
case ENTRY_CONSTRUCTOR_REF:
|
||||
/* case ENTRY_CONSTRUCTOR_REF:
|
||||
name = ENTRY_CONSTRUCTOR_REF_STRING;
|
||||
break;
|
||||
case ENTRY_CONSTRUCTOR_DECL:
|
||||
name = ENTRY_CONSTRUCTOR_DECL_STRING;
|
||||
break;
|
||||
break;*/
|
||||
case ENTRY_NAMESPACE_REF:
|
||||
name = ENTRY_NAMESPACE_REF_STRING;
|
||||
break;
|
||||
|
@ -307,9 +307,9 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
case ENTRY_INCLUDE_REF:
|
||||
name = ENTRY_INCLUDE_REF_STRING;
|
||||
break;
|
||||
case ENTRY_SUPER_REF:
|
||||
/* case ENTRY_SUPER_REF:
|
||||
name = ENTRY_SUPER_REF_STRING;
|
||||
break;
|
||||
break;*/
|
||||
case ENTRY_TYPE_DECL_T:
|
||||
name = ENTRY_TYPE_DECL_T_STRING;
|
||||
break;
|
||||
|
@ -382,8 +382,8 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
{
|
||||
switch (type)
|
||||
{
|
||||
case ENTRY_REF:
|
||||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_REF);
|
||||
/* case ENTRY_REF:
|
||||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_REF);*/
|
||||
case ENTRY_TYPE_REF:
|
||||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_TYPE_REF);
|
||||
// case ENTRY_TYPE_DECL:
|
||||
|
@ -392,10 +392,10 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_FUNCTION_REF);
|
||||
case ENTRY_FUNCTION_DECL:
|
||||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_FUNCTION_DECL);
|
||||
case ENTRY_CONSTRUCTOR_REF:
|
||||
/* case ENTRY_CONSTRUCTOR_REF:
|
||||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_CONSTRUCTOR_REF);
|
||||
case ENTRY_CONSTRUCTOR_DECL:
|
||||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_CONSTRUCTOR_DECL);
|
||||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_CONSTRUCTOR_DECL);*/
|
||||
case ENTRY_NAMESPACE_REF:
|
||||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_NAMESPACE_REF);
|
||||
case ENTRY_NAMESPACE_DECL:
|
||||
|
@ -416,8 +416,8 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_MACRO_DECL);
|
||||
case ENTRY_INCLUDE_REF:
|
||||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_INCLUDE_REF);
|
||||
case ENTRY_SUPER_REF:
|
||||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_SUPER_REF);
|
||||
/* case ENTRY_SUPER_REF:
|
||||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_SUPER_REF);*/
|
||||
case ENTRY_TYPE_DECL_T:
|
||||
return IndexerViewPluginImages.get(IndexerViewPluginImages.IMG_TYPEDEF);
|
||||
case ENTRY_TYPE_DECL_C:
|
||||
|
@ -757,13 +757,13 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
section.put(SETTINGS_WIDTH, size.x);
|
||||
section.put(SETTINGS_HEIGHT, size.y);
|
||||
|
||||
section.put(ENTRY_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_REF)));
|
||||
//section.put(ENTRY_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_REF)));
|
||||
section.put(ENTRY_TYPE_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_REF)));
|
||||
// section.put(ENTRY_TYPE_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL)));
|
||||
section.put(ENTRY_FUNCTION_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_FUNCTION_REF)));
|
||||
section.put(ENTRY_FUNCTION_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_FUNCTION_DECL)));
|
||||
section.put(ENTRY_CONSTRUCTOR_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_CONSTRUCTOR_REF)));
|
||||
section.put(ENTRY_CONSTRUCTOR_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_CONSTRUCTOR_DECL)));
|
||||
//section.put(ENTRY_CONSTRUCTOR_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_CONSTRUCTOR_REF)));
|
||||
//section.put(ENTRY_CONSTRUCTOR_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_CONSTRUCTOR_DECL)));
|
||||
section.put(ENTRY_NAMESPACE_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_NAMESPACE_REF)));
|
||||
section.put(ENTRY_NAMESPACE_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_NAMESPACE_DECL)));
|
||||
section.put(ENTRY_FIELD_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_FIELD_REF)));
|
||||
|
@ -774,7 +774,7 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
section.put(ENTRY_METHOD_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_METHOD_DECL)));
|
||||
section.put(ENTRY_MACRO_DECL_STRING, fFilterMatcher.contains(new Integer(ENTRY_MACRO_DECL)));
|
||||
section.put(ENTRY_INCLUDE_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_INCLUDE_REF)));
|
||||
section.put(ENTRY_SUPER_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_SUPER_REF)));
|
||||
//section.put(ENTRY_SUPER_REF_STRING, fFilterMatcher.contains(new Integer(ENTRY_SUPER_REF)));
|
||||
section.put(ENTRY_TYPE_DECL_T_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_T)));
|
||||
section.put(ENTRY_TYPE_DECL_C_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_C)));
|
||||
section.put(ENTRY_TYPE_DECL_V_STRING, fFilterMatcher.contains(new Integer(ENTRY_TYPE_DECL_V)));
|
||||
|
@ -799,13 +799,13 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
* Stores default dialog settings.
|
||||
*/
|
||||
protected void writeDefaultSettings(IDialogSettings section) {
|
||||
section.put(ENTRY_REF_STRING, true);
|
||||
//section.put(ENTRY_REF_STRING, true);
|
||||
section.put(ENTRY_TYPE_REF_STRING, true);
|
||||
// section.put(ENTRY_TYPE_DECL_STRING, true);
|
||||
section.put(ENTRY_FUNCTION_REF_STRING, true);
|
||||
section.put(ENTRY_FUNCTION_DECL_STRING, true);
|
||||
section.put(ENTRY_CONSTRUCTOR_REF_STRING, true);
|
||||
section.put(ENTRY_CONSTRUCTOR_DECL_STRING, true);
|
||||
//section.put(ENTRY_CONSTRUCTOR_REF_STRING, true);
|
||||
//section.put(ENTRY_CONSTRUCTOR_DECL_STRING, true);
|
||||
section.put(ENTRY_NAMESPACE_REF_STRING, true);
|
||||
section.put(ENTRY_NAMESPACE_DECL_STRING, true);
|
||||
section.put(ENTRY_FIELD_REF_STRING, true);
|
||||
|
@ -816,7 +816,7 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
section.put(ENTRY_METHOD_DECL_STRING, true);
|
||||
section.put(ENTRY_MACRO_DECL_STRING, true);
|
||||
section.put(ENTRY_INCLUDE_REF_STRING, true);
|
||||
section.put(ENTRY_SUPER_REF_STRING, true);
|
||||
//section.put(ENTRY_SUPER_REF_STRING, true);
|
||||
section.put(ENTRY_TYPE_DECL_T_STRING, true);
|
||||
section.put(ENTRY_TYPE_DECL_C_STRING, true);
|
||||
section.put(ENTRY_TYPE_DECL_V_STRING, true);
|
||||
|
@ -881,11 +881,11 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
fSize = null;
|
||||
}
|
||||
|
||||
if (section.getBoolean(ENTRY_REF_STRING)) {
|
||||
/* if (section.getBoolean(ENTRY_REF_STRING)) {
|
||||
Integer typeObject = new Integer(ENTRY_REF);
|
||||
if (fKnownTypes.contains(typeObject))
|
||||
fFilterMatcher.add(typeObject);
|
||||
}
|
||||
}*/
|
||||
if (section.getBoolean(ENTRY_TYPE_REF_STRING)) {
|
||||
Integer typeObject = new Integer(ENTRY_TYPE_REF);
|
||||
if (fKnownTypes.contains(typeObject))
|
||||
|
@ -906,7 +906,7 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
if (fKnownTypes.contains(typeObject))
|
||||
fFilterMatcher.add(typeObject);
|
||||
}
|
||||
if (section.getBoolean(ENTRY_CONSTRUCTOR_REF_STRING)) {
|
||||
/* if (section.getBoolean(ENTRY_CONSTRUCTOR_REF_STRING)) {
|
||||
Integer typeObject = new Integer(ENTRY_CONSTRUCTOR_REF);
|
||||
if (fKnownTypes.contains(typeObject))
|
||||
fFilterMatcher.add(typeObject);
|
||||
|
@ -915,7 +915,7 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
Integer typeObject = new Integer(ENTRY_CONSTRUCTOR_DECL);
|
||||
if (fKnownTypes.contains(typeObject))
|
||||
fFilterMatcher.add(typeObject);
|
||||
}
|
||||
}*/
|
||||
if (section.getBoolean(ENTRY_NAMESPACE_REF_STRING)) {
|
||||
Integer typeObject = new Integer(ENTRY_NAMESPACE_REF);
|
||||
if (fKnownTypes.contains(typeObject))
|
||||
|
@ -966,11 +966,11 @@ public class FilterIndexerViewDialog extends Dialog {
|
|||
if (fKnownTypes.contains(typeObject))
|
||||
fFilterMatcher.add(typeObject);
|
||||
}
|
||||
if (section.getBoolean(ENTRY_SUPER_REF_STRING)) {
|
||||
/*if (section.getBoolean(ENTRY_SUPER_REF_STRING)) {
|
||||
Integer typeObject = new Integer(ENTRY_SUPER_REF);
|
||||
if (fKnownTypes.contains(typeObject))
|
||||
fFilterMatcher.add(typeObject);
|
||||
}
|
||||
}*/
|
||||
if (section.getBoolean(ENTRY_TYPE_DECL_T_STRING)) {
|
||||
Integer typeObject = new Integer(ENTRY_TYPE_DECL_T);
|
||||
if (fKnownTypes.contains(typeObject))
|
||||
|
|
|
@ -17,9 +17,9 @@ import org.eclipse.cdt.core.browser.PathUtil;
|
|||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||
import org.eclipse.cdt.internal.core.index.IEntryResult;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexedFileEntry;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.BlocksIndexInput;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.io.IndexInput;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.ui.views.properties.IPropertyDescriptor;
|
||||
import org.eclipse.ui.views.properties.IPropertySource;
|
||||
|
@ -53,10 +53,10 @@ public class IndexerNodeLeaf implements IAdaptable {
|
|||
String stringBeforeName = null;
|
||||
|
||||
// set the filtersFlag
|
||||
if (word.startsWith(FilterIndexerViewDialog.ENTRY_REF_STRING)) {
|
||||
/*if (word.startsWith(FilterIndexerViewDialog.ENTRY_REF_STRING)) {
|
||||
stringBeforeName = FilterIndexerViewDialog.ENTRY_REF_STRING;
|
||||
filtersType = FilterIndexerViewDialog.ENTRY_REF;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_REF_STRING)) {
|
||||
} else */if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_REF_STRING)) {
|
||||
stringBeforeName = FilterIndexerViewDialog.ENTRY_TYPE_REF_STRING;
|
||||
filtersType = FilterIndexerViewDialog.ENTRY_TYPE_REF;
|
||||
// } else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_STRING)) {
|
||||
|
@ -68,13 +68,13 @@ public class IndexerNodeLeaf implements IAdaptable {
|
|||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_FUNCTION_DECL_STRING)) {
|
||||
stringBeforeName = FilterIndexerViewDialog.ENTRY_FUNCTION_DECL_STRING;
|
||||
filtersType = FilterIndexerViewDialog.ENTRY_FUNCTION_DECL;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_REF_STRING)) {
|
||||
} /*else if (word.startsWith(FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_REF_STRING)) {
|
||||
stringBeforeName = FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_REF_STRING;
|
||||
filtersType = FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_REF;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_DECL_STRING)) {
|
||||
stringBeforeName = FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_DECL_STRING;
|
||||
filtersType = FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_DECL;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_NAMESPACE_REF_STRING)) {
|
||||
}*/ else if (word.startsWith(FilterIndexerViewDialog.ENTRY_NAMESPACE_REF_STRING)) {
|
||||
stringBeforeName = FilterIndexerViewDialog.ENTRY_NAMESPACE_REF_STRING;
|
||||
filtersType = FilterIndexerViewDialog.ENTRY_NAMESPACE_REF;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_NAMESPACE_DECL_STRING)) {
|
||||
|
@ -104,10 +104,10 @@ public class IndexerNodeLeaf implements IAdaptable {
|
|||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_INCLUDE_REF_STRING)) {
|
||||
stringBeforeName = FilterIndexerViewDialog.ENTRY_INCLUDE_REF_STRING;
|
||||
filtersType = FilterIndexerViewDialog.ENTRY_INCLUDE_REF;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_SUPER_REF_STRING)) {
|
||||
} /*else if (word.startsWith(FilterIndexerViewDialog.ENTRY_SUPER_REF_STRING)) {
|
||||
stringBeforeName = FilterIndexerViewDialog.ENTRY_SUPER_REF_STRING;
|
||||
filtersType = FilterIndexerViewDialog.ENTRY_SUPER_REF;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_T_STRING)) {
|
||||
}*/ else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_T_STRING)) {
|
||||
stringBeforeName = FilterIndexerViewDialog.ENTRY_TYPE_DECL_T_STRING;
|
||||
filtersType = FilterIndexerViewDialog.ENTRY_TYPE_DECL_T;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_C_STRING)) {
|
||||
|
@ -294,8 +294,8 @@ public class IndexerNodeLeaf implements IAdaptable {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
if (!parent.isDisplayFullName() && name.indexOf(IIndexConstants.SEPARATOR) > 0)
|
||||
return name.substring(0, name.indexOf(IIndexConstants.SEPARATOR));
|
||||
if (!parent.isDisplayFullName() && name.indexOf(IndexerOutput.SEPARATOR) > 0)
|
||||
return name.substring(0, name.indexOf(IndexerOutput.SEPARATOR));
|
||||
|
||||
return name;
|
||||
}
|
||||
|
|
|
@ -228,8 +228,7 @@ public class IndexerQuery extends CSearchQuery implements ISearchQuery {
|
|||
* @see org.eclipse.search.ui.ISearchQuery#canRunInBackground()
|
||||
*/
|
||||
public boolean canRunInBackground() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.eclipse.cdt.core.search.ICSearchConstants;
|
|||
import org.eclipse.cdt.internal.core.index.IEntryResult;
|
||||
import org.eclipse.cdt.internal.core.index.IIndex;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexer;
|
||||
import org.eclipse.cdt.internal.core.index.sourceindexer.AbstractIndexer;
|
||||
import org.eclipse.cdt.internal.core.index.cindexstorage.IndexerOutput;
|
||||
import org.eclipse.cdt.ui.testplugin.CTestPlugin;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
|
@ -135,7 +135,7 @@ public class IndexerView extends ViewPart {
|
|||
int matchMode = ICSearchConstants.PATTERN_MATCH;
|
||||
boolean isCaseSensitive = false;
|
||||
|
||||
char[] queryString = AbstractIndexer.bestPrefix( prefix, optionalType, name, containingTypes, matchMode, isCaseSensitive);
|
||||
char[] queryString = IndexerOutput.bestPrefix( prefix, optionalType, name, containingTypes, matchMode, isCaseSensitive);
|
||||
|
||||
IEntryResult[] results = index.queryEntries(queryString);
|
||||
if (results == null) return Status.CANCEL_STATUS;
|
||||
|
@ -313,17 +313,17 @@ public class IndexerView extends ViewPart {
|
|||
if (obj instanceof IndexerNodeLeaf) {
|
||||
String word = String.valueOf(((IndexerNodeLeaf)obj).getResult().getWord());
|
||||
|
||||
if (word.startsWith(FilterIndexerViewDialog.ENTRY_REF_STRING)) {
|
||||
/*if (word.startsWith(FilterIndexerViewDialog.ENTRY_REF_STRING)) {
|
||||
imageKey = IndexerViewPluginImages.IMG_REF;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_FUNCTION_REF_STRING)) {
|
||||
} else*/ if (word.startsWith(FilterIndexerViewDialog.ENTRY_FUNCTION_REF_STRING)) {
|
||||
imageKey = IndexerViewPluginImages.IMG_FUNCTION_REF;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_FUNCTION_DECL_STRING)) {
|
||||
imageKey = IndexerViewPluginImages.IMG_FUNCTION_DECL;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_REF_STRING)) {
|
||||
} /*else if (word.startsWith(FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_REF_STRING)) {
|
||||
imageKey = IndexerViewPluginImages.IMG_CONSTRUCTOR_REF;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_CONSTRUCTOR_DECL_STRING)) {
|
||||
imageKey = IndexerViewPluginImages.IMG_CONSTRUCTOR_DECL;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_NAMESPACE_REF_STRING)) {
|
||||
}*/ else if (word.startsWith(FilterIndexerViewDialog.ENTRY_NAMESPACE_REF_STRING)) {
|
||||
imageKey = IndexerViewPluginImages.IMG_NAMESPACE_REF;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_NAMESPACE_DECL_STRING)) {
|
||||
imageKey = IndexerViewPluginImages.IMG_NAMESPACE_DECL;
|
||||
|
@ -343,9 +343,9 @@ public class IndexerView extends ViewPart {
|
|||
imageKey = IndexerViewPluginImages.IMG_MACRO_DECL;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_INCLUDE_REF_STRING)) {
|
||||
imageKey = IndexerViewPluginImages.IMG_INCLUDE_REF;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_SUPER_REF_STRING)) {
|
||||
}/* else if (word.startsWith(FilterIndexerViewDialog.ENTRY_SUPER_REF_STRING)) {
|
||||
imageKey = IndexerViewPluginImages.IMG_SUPER_REF;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_T_STRING)) {
|
||||
}*/ else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_T_STRING)) {
|
||||
imageKey = IndexerViewPluginImages.IMG_TYPEDEF;
|
||||
} else if (word.startsWith(FilterIndexerViewDialog.ENTRY_TYPE_DECL_C_STRING)) {
|
||||
imageKey = IndexerViewPluginImages.IMG_CLASS;
|
||||
|
@ -625,7 +625,7 @@ public class IndexerView extends ViewPart {
|
|||
protected void displayLocations(IndexerNodeLeaf leaf, String queryLabel, String pattern) {
|
||||
IndexerQuery job = new IndexerQuery(leaf, queryLabel, pattern);
|
||||
NewSearchUI.activateSearchResultView();
|
||||
NewSearchUI.runQuery(job);
|
||||
NewSearchUI.runQueryInBackground(job);
|
||||
}
|
||||
|
||||
public void run() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2003, 2004 IBM Corporation and others.
|
||||
* Copyright (c) 2003, 2005 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -26,7 +26,7 @@ import org.eclipse.jface.text.ITextSelection;
|
|||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.search.ui.SearchUI;
|
||||
import org.eclipse.search.ui.NewSearchUI;
|
||||
import org.eclipse.ui.IEditorDescriptor;
|
||||
import org.eclipse.ui.IEditorRegistry;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
|
@ -90,62 +90,11 @@ public class SearchDialogAction extends Action {
|
|||
}
|
||||
|
||||
if (fEditor != null){
|
||||
SearchUI.openSearchDialog(fEditor.getEditorSite().getWorkbenchWindow(),C_SEARCH_PAGE_ID);
|
||||
NewSearchUI.openSearchDialog(fEditor.getEditorSite().getWorkbenchWindow(),C_SEARCH_PAGE_ID);
|
||||
}
|
||||
else if (fWorkbenchWindow != null){
|
||||
SearchUI.openSearchDialog(fWorkbenchWindow,C_SEARCH_PAGE_ID);
|
||||
NewSearchUI.openSearchDialog(fWorkbenchWindow,C_SEARCH_PAGE_ID);
|
||||
}
|
||||
// // @@@ we rely on the internal functions of the Search plugin, since
|
||||
// // none of these are actually exported. This is probably going to change
|
||||
// // with 2.0.
|
||||
// TextSearchResultCollector col = new TextSearchResultCollector();
|
||||
// try {
|
||||
// //TextSearchPage
|
||||
// //ProgressMonitor monitor = new ProgressMonitor();
|
||||
// //col.setProgressMonitor(monitor)
|
||||
// SearchUI.activateSearchResultView();
|
||||
// //col.aboutToStart();
|
||||
//
|
||||
// // We now have the element, start a search on the string
|
||||
// //TextSearchEngine engine = new TextSearchEngine();
|
||||
// TextSearchScope scope= TextSearchScope.newWorkspaceScope();
|
||||
// // Add the extensions from the C editor definition for now
|
||||
// // FIXME: For C/C++ not all files rely on extension to be C++ for <cstring>
|
||||
// String[] cexts = CoreModel.getDefault().getTranslationUnitExtensions();
|
||||
// for (int i = 0; i < cexts.length; i++) {
|
||||
// scope.addExtension("*." + cexts[i]);
|
||||
// }
|
||||
//// scope.addExtension("*.c");
|
||||
//// scope.addExtension("*.h");
|
||||
//// scope.addExtension("*.cc");
|
||||
//// scope.addExtension("*.hh");
|
||||
//
|
||||
// TextSearchOperation op= new TextSearchOperation(
|
||||
// CUIPlugin.getWorkspace(),
|
||||
// search_name,
|
||||
// "",
|
||||
// scope,
|
||||
// col);
|
||||
//
|
||||
//
|
||||
// //engine.search(CUIPlugin.getWorkspace(), element.getName(),
|
||||
// // null, scope, col);
|
||||
// IRunnableContext context= null;
|
||||
// //context= getContainer().getRunnableContext();
|
||||
//
|
||||
// Shell shell= new Shell(); // getShell();
|
||||
// if (context == null)
|
||||
// context= new ProgressMonitorDialog(shell);
|
||||
//
|
||||
//
|
||||
// try {
|
||||
// context.run(true, true, op);
|
||||
// } catch (InvocationTargetException ex) {
|
||||
// ExceptionHandler.handle(ex, "Error","Error"); //$NON-NLS-2$ //$NON-NLS-1$
|
||||
// } catch (InterruptedException e) {
|
||||
// }
|
||||
// } catch (Exception e) {}
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ import org.eclipse.jface.viewers.ISelection;
|
|||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
|
||||
import org.eclipse.search.ui.ISearchPage;
|
||||
import org.eclipse.search.ui.ISearchPageContainer;
|
||||
import org.eclipse.search.ui.ISearchResultViewEntry;
|
||||
|
@ -135,7 +134,7 @@ public class CSearchPage extends DialogPage implements ISearchPage, ICSearchCons
|
|||
CSearchQuery job = new CSearchQuery(workspace, data.pattern, data.isCaseSensitive, searching, data.limitTo, scope, scopeDescription, null);
|
||||
NewSearchUI.activateSearchResultView();
|
||||
|
||||
NewSearchUI.runQuery(job);
|
||||
NewSearchUI.runQueryInBackground(job);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ package org.eclipse.cdt.internal.ui.search;
|
|||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.search.ui.SearchUI;
|
||||
import org.eclipse.search.ui.NewSearchUI;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
|
||||
|
@ -44,7 +44,7 @@ public class OpenCSearchPageAction implements IWorkbenchWindowActionDelegate {
|
|||
beep();
|
||||
return;
|
||||
}
|
||||
SearchUI.openSearchDialog(fWindow, C_SEARCH_PAGE_ID);
|
||||
NewSearchUI.openSearchDialog(fWindow, C_SEARCH_PAGE_ID);
|
||||
}
|
||||
|
||||
public void selectionChanged(IAction action, ISelection selection) {
|
||||
|
|
|
@ -124,7 +124,7 @@ public abstract class FindAction extends SelectionParseAction {
|
|||
CSearchQuery job = createSearchQuery( element.getElementName(), CSearchUtil.getSearchForFromElement(element));
|
||||
NewSearchUI.activateSearchResultView();
|
||||
|
||||
NewSearchUI.runQuery(job);
|
||||
NewSearchUI.runQueryInBackground(job);
|
||||
}
|
||||
|
||||
public void run(ITextSelection sel){
|
||||
|
@ -169,7 +169,7 @@ public abstract class FindAction extends SelectionParseAction {
|
|||
|
||||
NewSearchUI.activateSearchResultView();
|
||||
|
||||
NewSearchUI.runQuery(job);
|
||||
NewSearchUI.runQueryInBackground(job);
|
||||
}
|
||||
|
||||
abstract protected String getScopeDescription();
|
||||
|
|
Loading…
Add table
Reference in a new issue