Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Indexer Patch


This patch adds namespaces, enums, typedefs, functions, methods, fields and vars to the index. It also fixes a problem with the Search label provider which caused it to not display properly under some conditions. (Note this patch does not affect any other components).

- Bogdan

 
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/ChangeLog,v
retrieving revision 1.26
diff -u -r1.26 ChangeLog
--- ChangeLog	21 Jul 2003 17:30:00 -0000	1.26
+++ ChangeLog	21 Jul 2003 18:59:26 -0000
@@ -1,3 +1,6 @@
+2003-07-21 Bogdan Gheorghe
+	Added new indexer test for newly added declarations
+	
 2003-07-21 John Camelon
 	Created CompleteParseASTTest and added it to ParserTestSuite.
 
Index: indexer/org/eclipse/cdt/core/indexer/tests/IndexManagerTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/indexer/org/eclipse/cdt/core/indexer/tests/IndexManagerTests.java,v
retrieving revision 1.2
diff -u -r1.2 IndexManagerTests.java
--- indexer/org/eclipse/cdt/core/indexer/tests/IndexManagerTests.java	17 Jul 2003 20:15:02 -0000	1.2
+++ indexer/org/eclipse/cdt/core/indexer/tests/IndexManagerTests.java	21 Jul 2003 18:59:26 -0000
@@ -21,6 +21,7 @@
 import org.eclipse.cdt.internal.core.index.IIndex;
 import org.eclipse.cdt.internal.core.index.IQueryResult;
 import org.eclipse.cdt.internal.core.index.impl.IFileDocument;
+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;
@@ -63,9 +64,7 @@
 		//Create temp project
 		testProject = createProject("IndexerTestProject");
 		if (testProject==null)
-			fail("Unable to create project");
-		//Add a file to the project
-		importFile("mail.cpp","resources/indexer/mail.cpp");	
+			fail("Unable to create project");	
 	}
 	/*
 	 * @see TestCase#tearDown()
@@ -78,7 +77,10 @@
 		}
 	}
 
-	public static Test suite() { 
+	public static Test suite() {
+		//TestSuite suite = new TestSuite();
+		//suite.addTest(new IndexManagerTests("testIndexContents"));
+		//return suite;
 		return new TestSuite(IndexManagerTests.class);
 	}
 	/*
@@ -136,6 +138,8 @@
 	 * Start of tests
 	 */ 	
 	public void testIndexAll() throws Exception {
+		//Add a file to the project
+		importFile("mail.cpp","resources/indexer/mail.cpp");
 		//Enable indexing on the created project
 		//By doing this, we force the Index Manager to indexAll()
 		indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
@@ -167,6 +171,8 @@
 	}
 	
 	public void testAddNewFileToIndex() throws Exception{
+		//Add a file to the project
+		importFile("mail.cpp","resources/indexer/mail.cpp");
 		//Enable indexing on the created project
 		//By doing this, we force the Index Manager to indexAll()
 		indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
@@ -194,6 +200,8 @@
 	}
 
 	public void testRemoveProjectFromIndex() throws Exception{
+	  //Add a file to the project
+	  importFile("mail.cpp","resources/indexer/mail.cpp");
 	  //Enable indexing on the created project
 	  //By doing this, we force the Index Manager to indexAll()
 	  indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
@@ -211,6 +219,8 @@
 	}
 	
 	public void testRemoveFileFromIndex() throws Exception{
+	 //Add a file to the project
+	 importFile("mail.cpp","resources/indexer/mail.cpp");
 	 //Enable indexing on the created project
 	 //By doing this, we force the Index Manager to indexAll()
 	 indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
@@ -252,4 +262,83 @@
 	 }
 	}
 	
+	public void testIndexContents() throws Exception{
+		//Add a new file to the project, give it some time to index
+		importFile("extramail.cpp","resources/indexer/extramail.cpp");
+		//Enable indexing on the created project
+		//By doing this, we force the Index Manager to indexAll()
+		indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
+		indexManager.setEnabled(testProject,true);
+		Thread.sleep(15000);
+		//Make sure project got added to index
+		IPath testProjectPath = testProject.getFullPath();
+		IIndex ind = indexManager.getIndex(testProjectPath,true,true);
+		assertTrue("Index exists for project",ind != null);
+	
+		String [] typeDeclEntryResultModel ={"EntryResult: word=typeDecl/C/Mail/Z/X/Y, refs={ 1 }","EntryResult: word=typeDecl/C/Unknown/Z/X/Y, refs={ 1 }","EntryResult: word=typeDecl/C/container/Z/X/Y, refs={ 1 }","EntryResult: word=typeDecl/C/first_class/Z/X/Y, refs={ 1 }","EntryResult: word=typeDecl/C/postcard/Z/X/Y, refs={ 1 }","EntryResult: word=typeDecl/E/test/Z/X/Y, refs={ 1 }","EntryResult: word=typeDecl/V/x/Z, refs={ 1 }"};
+		IEntryResult[] typedeclresults =ind.queryEntries(IIndexConstants.TYPE_DECL);
+
+		if (typedeclresults.length != typeDeclEntryResultModel.length)
+			fail("Entry Result length different from model for typeDecl");
+	
+		for (int i=0;i<typedeclresults.length; i++)
+		{
+			assertEquals(typeDeclEntryResultModel[i],typedeclresults[i].toString());
+		}
+	
+		String [] typeDefEntryResultModel ={"EntryResult: word=typedefDecl/int32, refs={ 1 }"};
+		IEntryResult[] typedefresults =ind.queryEntries(IIndexConstants.TYPEDEF_DECL);
+		
+		if (typedefresults.length != typeDefEntryResultModel.length)
+					fail("Entry Result length different from model for typeDef");
+	
+		for (int i=0;i<typedefresults.length; i++)
+		{
+		 assertEquals(typeDefEntryResultModel[i],typedefresults[i].toString());
+		}
+				
+		String [] namespaceResultModel = {"EntryResult: word=namespaceDecl/X/Z, refs={ 1 }", "EntryResult: word=namespaceDecl/Y/Z/X, refs={ 1 }", "EntryResult: word=namespaceDecl/Z, refs={ 1 }"};
+		IEntryResult[] namespaceresults =ind.queryEntries(IIndexConstants.NAMESPACE_DECL);
+		
+		if (namespaceresults.length != namespaceResultModel.length)
+				fail("Entry Result length different from model for namespace");
+	
+		for (int i=0;i<namespaceresults.length; i++)
+		{
+			assertEquals(namespaceResultModel[i],namespaceresults[i].toString());
+		}
+				
+		String [] fieldResultModel = {"EntryResult: word=fieldDecl/array/Z/X/Y/container, refs={ 1 }", "EntryResult: word=fieldDecl/bye/Z/X/Y/test, refs={ 1 }", "EntryResult: word=fieldDecl/cool/Z/X/Y/test, refs={ 1 }", "EntryResult: word=fieldDecl/hi/Z/X/Y/test, refs={ 1 }", "EntryResult: word=fieldDecl/index/Z/X/Y/container, refs={ 1 }", "EntryResult: word=fieldDecl/postage/Z/X/Y/Mail, refs={ 1 }", "EntryResult: word=fieldDecl/sz/Z/X/Y/container, refs={ 1 }", "EntryResult: word=fieldDecl/type/Z/X/Y/Mail, refs={ 1 }", "EntryResult: word=fieldDecl/why/Z/X/Y/test, refs={ 1 }"};
+		IEntryResult[] fieldresults =ind.queryEntries(IIndexConstants.FIELD_DECL);
+	
+		if (fieldresults.length != fieldResultModel.length)
+				fail("Entry Result length different from model for fieldDecl");
+	
+		for (int i=0;i<fieldresults.length; i++)
+		{
+			assertEquals(fieldResultModel[i],fieldresults[i].toString());
+		}
+	
+		String [] functionResultModel = {"EntryResult: word=functionDecl/doSomething, refs={ 1 }"};	
+		IEntryResult[] functionresults =ind.queryEntries(IIndexConstants.FUNCTION_DECL);
+		
+		if (functionresults.length != functionResultModel.length)
+					fail("Entry Result length different from model for functionDecl");
+	
+		for (int i=0;i<functionresults.length; i++)
+		{
+			assertEquals(functionResultModel[i],functionresults[i].toString());
+		}
+		
+		String [] methodResultModel = {"EntryResult: word=methodDecl/operator<</Z/X/Y/Mail, refs={ 1 }","EntryResult: word=methodDecl/operator=/Z/X/Y/container, refs={ 1 }","EntryResult: word=methodDecl/operator[]/Z/X/Y/container, refs={ 1 }","EntryResult: word=methodDecl/print/Z/X/Y/Mail, refs={ 1 }"};	
+		IEntryResult[] methodresults =ind.queryEntries(IIndexConstants.METHOD_DECL);
+		
+		if (methodresults.length != methodResultModel.length)
+				fail("Entry Result length different from model for functionDecl");
+	
+		for (int i=0;i<methodresults.length; i++)
+		{
+			assertEquals(methodResultModel[i],methodresults[i].toString());
+		}
+  }
 }
Index: resources/indexer/extramail.cpp
===================================================================
RCS file: resources/indexer/extramail.cpp
diff -N resources/indexer/extramail.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ resources/indexer/extramail.cpp	21 Jul 2003 18:59:27 -0000
@@ -0,0 +1,108 @@
+#include <iostream.h>
+#include <stdlib.h>
+#include <alloc.h>
+#include <iomanip.h>
+
+typedef int int32;
+
+static void doSomething();
+
+namespace Z{
+	int x;
+	namespace X{
+		namespace Y{
+			enum test{cool,hi,bye,why};
+			class Mail
+			{
+			public:
+			Mail(){}
+			virtual void print()=0; //Pure Virtual Function, forces redefinition
+			protected:
+			float postage;
+			char *type;
+			friend ostream& operator << (ostream& os, Mail *m);
+			};
+			
+			class postcard : public Mail
+			{
+			public:
+			postcard(): Mail(){postage = 0.20; type = "Postcard";}
+			void print(){cout << type << ": $" << setiosflags(ios::fixed)
+			 <<setprecision(2) << postage <<endl;}
+			 };
+			
+			class first_class : public Mail
+			{
+			public:
+			first_class() : Mail(){postage = 0.32; type = "First Class";}
+			void print(){cout << type << ": $" <<setiosflags(ios::fixed)
+			             << setprecision(2) << postage <<endl;}
+			 
+			};
+			
+			class Unknown : public postcard, first_class // ??? Multiple Inheritance
+			{
+			public:
+			Unknown(): postcard(), first_class()
+			{
+			postcard::postage = 1.50; // MUST disambiguate
+			postcard::type = "Unknown";
+			}
+			void print(){cout << postcard::type << ": $" <<setiosflags(ios::fixed)
+			             <<setprecision(2)<<postcard::postage <<endl;}
+			 };
+			
+			class container
+			{
+			private:
+			Mail **array;
+			int index;
+			int sz;
+			public:
+			container(){array = 0;}
+			~container(){
+			for(int x = 0; x <sz; x++)
+			 delete array[x];
+			free(array);
+			}
+			int size() {return sz;}
+			Mail* operator[](int index);
+			Mail* operator = (Mail* mail);
+			};
+			
+			main()
+			{
+			container PO_Box;
+			PO_Box = new postcard;
+			PO_Box = new first_class;
+			PO_Box = new parcel_Post;
+			//PO_Box = new Unknown;
+			//one way of printing information
+			for(int x =0; x <3; x++){
+			 PO_Box[x]->print();
+			}
+			//Overloaded  <<
+			 for(int x =0; x <PO_Box.size(); x++){
+			 cout << PO_Box[x];
+			 }
+			}
+			
+			ostream& operator << (ostream &os, Mail *m)
+			{
+			os <<setiosflags(ios::fixed) << setprecision(2)<< m->type
+			<< ": $" << m->postage <<endl;
+			
+			return os;
+			}
+			Mail* container::operator[](int index) {return array[index];}
+			Mail* container::operator = (Mail* mail)
+			{ 
+			int size = sizeof(Mail*) * (++sz); 
+			int temp = sz -1; 
+			array = (Mail**)realloc(array, size); 
+			array[temp] = mail; 
+			return 0; 
+			}
+		}
+	}	
+}	
Index: index/ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/index/ChangeLog,v
retrieving revision 1.3
diff -u -r1.3 ChangeLog
--- index/ChangeLog	11 Jul 2003 22:12:35 -0000	1.3
+++ index/ChangeLog	21 Jul 2003 18:57:34 -0000
@@ -1,3 +1,17 @@
+2003-07-21 Bogdan Gheorghe
+	Added additional declarations to index: enums, enumerators, namespace,
+	functions, vars, methods, fields, typedefs.
+	
+	Fixed IndexManager to prevent individually added files from
+	being added to the index if indexing is not enabled for the project
+	
+	Modified:
+	
+	* index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java
+	* index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java
+	* index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java
+	* index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java
+	
 2003-07-10 Bogdan Gheorghe
 	Added bestTypeDeclarationPrefix to AbstractIndexer to allow the
 	search engine to create a query string for the index.
Index: index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java,v
retrieving revision 1.4
diff -u -r1.4 AbstractIndexer.java
--- index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java	11 Jul 2003 22:12:35 -0000	1.4
+++ index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java	21 Jul 2003 18:57:34 -0000
@@ -12,9 +12,18 @@
 package org.eclipse.cdt.internal.core.search.indexing;
 
 import java.io.IOException;
+import java.util.Iterator;
 
 import org.eclipse.cdt.core.parser.ast.ASTClassKind;
 import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
+import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
+import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
+import org.eclipse.cdt.core.parser.ast.IASTField;
+import org.eclipse.cdt.core.parser.ast.IASTFunction;
+import org.eclipse.cdt.core.parser.ast.IASTMethod;
+import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
+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.IDocument;
 import org.eclipse.cdt.internal.core.index.IIndexer;
@@ -27,7 +36,9 @@
 	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;
+
 	public AbstractIndexer() {
 		super();
 	}
@@ -48,6 +59,43 @@
 		}
 	}
 	
+	public void addEnumerationSpecifier(IASTEnumerationSpecifier enumeration) {
+		this.output.addRef(encodeTypeEntry(enumeration.getFullyQualifiedName(), ENUM));
+		
+	Iterator i = enumeration.getEnumerators();
+		while (i.hasNext())
+		{
+			IASTEnumerator en = (IASTEnumerator) i.next(); 	
+			String name = en.getName();
+			IASTEnumerationSpecifier parent = en.getOwnerEnumerationSpecifier();
+			String[] parentName = parent.getFullyQualifiedName();
+			String[] enumeratorFullName = new String[parentName.length + 1];
+			int pos;
+			System.arraycopy(parentName, 0, enumeratorFullName, 0, pos = parentName.length);
+			enumeratorFullName[pos++] = name;
+			this.output.addRef(encodeEntry(enumeratorFullName,FIELD_DECL,FIELD_DECL_LENGTH));
+
+		}
+	}
+	
+	
+	public void addVariable(IASTVariable variable) {
+
+		this.output.addRef(encodeTypeEntry(variable.getFullyQualifiedName(), VAR));
+	}
+	
+	public void addTypedefDeclaration(IASTTypedefDeclaration typedef) {
+		this.output.addRef(encodeEntry(typedef.getFullyQualifiedName(), TYPEDEF_DECL, TYPEDEF_DECL_LENGTH));
+	}
+	
+	public void addFieldDeclaration(IASTField field) {
+		this.output.addRef(encodeEntry(field.getFullyQualifiedName(),FIELD_DECL,FIELD_DECL_LENGTH));
+	}
+	
+	public void addMethodDeclaration(IASTMethod method) {
+		this.output.addRef(encodeEntry(method.getFullyQualifiedName(),METHOD_DECL,METHOD_DECL_LENGTH));
+	}
+	
 	public void addConstructorDeclaration(){
 		
 	}
@@ -62,8 +110,8 @@
 	
 	}
 
-	public void addFunctionDeclaration(){
-	
+	public void addFunctionDeclaration(IASTFunction function){
+		this.output.addRef(encodeEntry(function.getFullyQualifiedName(),FUNCTION_DECL,FUNCTION_DECL_LENGTH));
 	}
 	
 	public void addFunctionReference(){
@@ -74,17 +122,21 @@
 		
 	}
 	
+	public void addNamespaceDefinition(IASTNamespaceDefinition namespace){
+		this.output.addRef(encodeEntry(namespace.getFullyQualifiedName(),NAMESPACE_DECL,NAMESPACE_DECL_LENGTH));
+	}
+
 	private void addSuperTypeReference(int modifiers, char[] packageName, char[] typeName, char[][] enclosingTypeNames, char classOrInterface, char[] superTypeName, char superClassOrInterface){
 
 	}
 	
 	public void addTypeReference(char[] typeName){
-		this.output.addRef(CharOperation.concat(TYPE_REF, CharOperation.lastSegment(typeName, '.')));
+		//this.output.addRef(CharOperation.concat(TYPE_REF, CharOperation.lastSegment(typeName, '.')));
 	}
 	/**
-	 * Type entries are encoded as follow: 'typeDecl/' ('C' | 'S' | 'U' ) '/'  TypeName '/' 
+	 * Type entries are encoded as follow: 'typeDecl/' ('C' | 'S' | 'U' | 'E' ) '/'  TypeName ['/' Qualifier]* 
 	 */
-	 protected static final char[] encodeTypeEntry( String [] fullTypeName, int classType) {
+	 protected static final char[] encodeTypeEntry( String [] fullTypeName, int typeType) {
 		int pos, nameLength = 0;
 		for (int i=0; i<fullTypeName.length; i++){
 			String namePart = fullTypeName[i];
@@ -93,7 +145,7 @@
 		//char[] has to be of size - [type decl length + length of the name + separators + letter]
 		char[] result = new char[TYPE_DECL_LENGTH + nameLength + fullTypeName.length + 1 ];
 		System.arraycopy(TYPE_DECL, 0, result, 0, pos = TYPE_DECL_LENGTH);
-		switch (classType)
+		switch (typeType)
 		{
 			case(CLASS):
 			result[pos++] = CLASS_SUFFIX;
@@ -106,6 +158,14 @@
 			case(UNION):
 			result[pos++] = UNION_SUFFIX;
 			break;
+			
+			case(ENUM):
+			result[pos++] = ENUM_SUFFIX;
+			break;
+			
+			case (VAR):
+			result[pos++] = VAR_SUFFIX;
+			break;
 		}
 		result[pos++] = SEPARATOR;
 		//Encode in the following manner
@@ -126,6 +186,35 @@
 		return result;
 	}
 	/**
+	 * Namespace entries are encoded as follow: '[prefix]/' TypeName ['/' Qualifier]*
+	 */
+	protected static final char[] encodeEntry(String[] elementName, char[] prefix, int prefixSize) {
+		int pos, nameLength = 0;
+		for (int i=0; i<elementName.length; i++){
+			String 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].toCharArray();
+			System.arraycopy(tempName, 0, result, pos, tempName.length);
+			pos += tempName.length;
+		}
+		//Extract the qualifiers
+		for (int i=0; i<(elementName.length - 1); i++){
+			result[pos++] = SEPARATOR;
+			char [] tempName = elementName[i].toCharArray();
+			System.arraycopy(tempName, 0, result, pos, tempName.length);
+			pos+=tempName.length;				
+		}
+		return result;
+	}
+	
+	/**
 	 * Returns the file types the <code>IIndexer</code> handles.
 	 */
 	public abstract String[] getFileTypes();
@@ -219,5 +308,60 @@
 		
 		return result;
 	}
+	
+	public static final char[] bestNamespacePrefix(char[] namespaceName, char[][] containingTypes, int matchMode, boolean isCaseSensitive) {
+		   // index is case sensitive, thus in case attempting case insensitive search, cannot consider
+		   // type name.
+		   if (!isCaseSensitive){
+			   namespaceName = null;
+		   }
+		
+		   switch(matchMode){
+			   case EXACT_MATCH :
+			   case PREFIX_MATCH :
+				   break;
+			   case PATTERN_MATCH :
+				   if (namespaceName != null){
+					   int starPos = CharOperation.indexOf('*', namespaceName);
+					   switch(starPos) {
+						   case -1 :
+							   break;
+						   case 0 :
+							   namespaceName = null;
+							   break;
+						   default : 
+							   namespaceName = CharOperation.subarray(namespaceName, 0, starPos);
+					   }
+				   }
+		   }
+		
+		   int containingTypesLength=0; 
+		   int typeLength = namespaceName == null ? 0 : namespaceName.length;
+		   int pos;
+		   //figure out the total length of the qualifiers
+		   for (int i=0; i<containingTypes.length; i++){
+			   containingTypesLength+= containingTypes[i].length;
+		   }
+		   //typed decl length + length of qualifiers + qualifier separators + name length + 2 (1 for name separator, 1 for letter)
+		   char[] result = new char[TYPE_DECL_LENGTH + containingTypesLength + containingTypes.length + typeLength + 2 ];
+		   System.arraycopy(TYPE_DECL, 0, result, 0, pos = TYPE_DECL_LENGTH);
+		   //result[pos++] = classType;
+		   result[pos++] = SEPARATOR;
+		
+		   if (typeLength > 0){
+			   System.arraycopy(namespaceName, 0, result, pos, namespaceName.length);
+			   pos += namespaceName.length;
+		   }
+				
+		   for (int i=0; i<containingTypes.length; i++){
+			   result[pos++] = SEPARATOR;
+			   char[] tempName = containingTypes[i];
+			   System.arraycopy(tempName, 0, result, pos, tempName.length);
+			   pos += tempName.length;
+		   }
+		
+		   return result;
+	   }
+
 }
 
Index: index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java,v
retrieving revision 1.2
diff -u -r1.2 IIndexConstants.java
--- index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java	4 Jul 2003 03:02:07 -0000	1.2
+++ index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java	21 Jul 2003 18:57:34 -0000
@@ -24,16 +24,25 @@
 	
 	char[] FUNCTION_REF= "functionRef/".toCharArray(); //$NON-NLS-1$
 	char[] FUNCTION_DECL= "functionDecl/".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$
 	char[] NAMESPACE_DECL= "namespaceDecl/".toCharArray(); //$NON-NLS-1$
+	int NAMESPACE_DECL_LENGTH = 14;
 		
-	char[] MEMBER_REF= "memberRef/".toCharArray(); //$NON-NLS-1$
-	char[] MEMBER_DECL= "memberDecl/".toCharArray(); //$NON-NLS-1$
-
+	char[] FIELD_REF= "fieldRef/".toCharArray(); //$NON-NLS-1$
+	char[] FIELD_DECL= "fieldDecl/".toCharArray(); //$NON-NLS-1$
+	int FIELD_DECL_LENGTH = 10;
+	
+	char[] METHOD_REF= "methodRef/".toCharArray(); //$NON-NLS-1$
+	char[] METHOD_DECL= "methodDecl/".toCharArray(); //$NON-NLS-1$
+	int METHOD_DECL_LENGTH = 11;
+		
+	char[] TYPEDEF_DECL = "typedefDecl/".toCharArray(); //$NON-NLS-1$
+	int TYPEDEF_DECL_LENGTH = 12;
 	//a Var REF will be treated as  a typeREF
 	//char[] VAR_REF= "varRef/".toCharArray(); //$NON-NLS-1$
 	
Index: index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java,v
retrieving revision 1.2
diff -u -r1.2 IndexManager.java
--- index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java	4 Jul 2003 03:02:07 -0000	1.2
+++ index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java	21 Jul 2003 18:57:35 -0000
@@ -100,6 +100,14 @@
 	 * Note: the actual operation is performed in background
 	 */
 	public void addSource(IFile resource, IPath indexedContainer){
+	
+		/******
+		*TODO: Remove these methods once the new indexer is
+		*fully integrated
+		*/
+		IProject project= resource.getProject();
+		if (!isEnabled(project)) return;
+
 		if (CCorePlugin.getDefault() == null) return;	
 		AddCompilationUnitToIndex job = new AddCompilationUnitToIndex(resource, indexedContainer, this);
 		if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) {
@@ -245,6 +253,12 @@
 	 */
 	public void indexSourceFolder(CProject javaProject, IPath sourceFolder, final char[][] exclusionPattern) {
 		IProject project = javaProject.getProject();
+		/******
+		*TODO: Remove these methods once the new indexer is
+		*fully integrated
+		*/
+		if (!isEnabled(project)) return;
+
 		if (this.jobEnd > this.jobStart) {
 			// check if a job to index the project is not already in the queue
 			IndexRequest request = new IndexAllProject(project, this);
@@ -301,6 +315,12 @@
 		IndexRequest request = null;
 		if (target instanceof IProject) {
 			IProject p = (IProject) target;
+			/******
+			*TODO: Remove these methods once the new indexer is
+			*fully integrated
+			*/
+			if (!isEnabled(p)) return;
+
 			//if (JavaProject.hasJavaNature(p))
 				request = new IndexAllProject(p, this);
 		}
@@ -384,6 +404,12 @@
 	 */
 	public void removeSourceFolderFromIndex(CProject javaProject, IPath sourceFolder, char[][] exclusionPatterns) {
 		IProject project = javaProject.getProject();
+		/******
+		*TODO: Remove these methods once the new indexer is
+		*fully integrated
+		*/
+		if (!isEnabled(project)) return;
+
 		if (this.jobEnd > this.jobStart) {
 			// check if a job to index the project is not already in the queue
 			IndexRequest request = new IndexAllProject(project, this);
Index: index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java,v
retrieving revision 1.6
diff -u -r1.6 SourceIndexerRequestor.java
--- index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java	18 Jul 2003 16:39:22 -0000	1.6
+++ index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java	21 Jul 2003 18:57:35 -0000
@@ -15,10 +15,8 @@
 * @author bgheorgh
 */
 
-import org.eclipse.cdt.core.parser.IParser;
 import org.eclipse.cdt.core.parser.IProblem;
 import org.eclipse.cdt.core.parser.ISourceElementRequestor;
-import org.eclipse.cdt.core.parser.IToken;
 import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
 import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration;
 import org.eclipse.cdt.core.parser.ast.IASTClassReference;
@@ -93,6 +91,7 @@
 	public void acceptVariable(IASTVariable variable) {
 		// TODO Auto-generated method stub
 		//System.out.println("acceptVariable");
+		indexer.addVariable(variable);
 	}
 
 	/* (non-Javadoc)
@@ -101,6 +100,7 @@
 	public void acceptFunctionDeclaration(IASTFunction function) {
 		// TODO Auto-generated method stub
 		//System.out.println("acceptFunctionDeclaration");
+		indexer.addFunctionDeclaration(function);
 	}
 
 	/* (non-Javadoc)
@@ -132,7 +132,7 @@
 	 */
 	public void acceptTypedefDeclaration(IASTTypedefDeclaration typedef) {
 		// TODO Auto-generated method stub
-		//System.out.println("acceptTypedef");
+		indexer.addTypedefDeclaration(typedef);
 	}
 
 	/* (non-Javadoc)
@@ -141,6 +141,7 @@
 	public void acceptEnumerationSpecifier(IASTEnumerationSpecifier enumeration) {
 		// TODO Auto-generated method stub
 		//System.out.println("acceptEnumSpecifier");
+		indexer.addEnumerationSpecifier(enumeration);
 	}
 
 	/* (non-Javadoc)
@@ -184,6 +185,7 @@
 	public void enterNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) {
 		// TODO Auto-generated method stub
 		//System.out.println("enterNamespaceDefinition");
+		indexer.addNamespaceDefinition(namespaceDefinition);
 	}
 
 	/* (non-Javadoc)
@@ -236,6 +238,7 @@
 	public void acceptMethodDeclaration(IASTMethod method) {
 		// TODO Auto-generated method stub
 		//System.out.println("acceptMethodDeclaration");
+		indexer.addMethodDeclaration(method);
 	}
 
 	/* (non-Javadoc)
@@ -259,7 +262,8 @@
 	 */
 	public void acceptField(IASTField field) {
 		// TODO Auto-generated method stub
-		//System.out.println("acceptField");
+	  // System.out.println("acceptField");
+	   indexer.addFieldDeclaration(field);
 	}
 
 	/* (non-Javadoc)
@@ -336,803 +340,75 @@
 		// TODO Auto-generated method stub
 		//System.out.println("exitCompilationUnit");
 
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#setParser(org.eclipse.cdt.core.parser.IParser)
-	 */
-	public void setParser(IParser parser) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#translationUnitBegin()
-	 */
-	public Object translationUnitBegin() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#translationUnitEnd(java.lang.Object)
-	 */
-	public void translationUnitEnd(Object unit) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#inclusionBegin(java.lang.String, int, int, boolean)
-	 */
-	public Object inclusionBegin(String includeFile, int nameBeginOffset, int inclusionBeginOffset, boolean local) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#inclusionEnd(java.lang.Object)
-	 */
-	public void inclusionEnd(Object inclusion) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#macro(java.lang.String, int, int, int)
-	 */
-	public Object macro(String macroName, int macroNameOffset, int macroBeginOffset, int macroEndOffset) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#simpleDeclarationBegin(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public Object simpleDeclarationBegin(Object Container, IToken firstToken) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#simpleDeclSpecifier(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void simpleDeclSpecifier(Object Container, IToken specifier) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#simpleDeclSpecifierName(java.lang.Object)
-	 */
-	public void simpleDeclSpecifierName(Object declaration) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#simpleDeclSpecifierType(java.lang.Object, java.lang.Object)
-	 */
-	public void simpleDeclSpecifierType(Object declaration, Object type) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#simpleDeclarationEnd(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void simpleDeclarationEnd(Object declaration, IToken lastToken) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#parameterDeclarationBegin(java.lang.Object)
-	 */
-	public Object parameterDeclarationBegin(Object Container) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#parameterDeclarationEnd(java.lang.Object)
-	 */
-	public void parameterDeclarationEnd(Object declaration) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#nameBegin(org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void nameBegin(IToken firstToken) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#nameEnd(org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void nameEnd(IToken lastToken) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#declaratorBegin(java.lang.Object)
-	 */
-	public Object declaratorBegin(Object container) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#declaratorId(java.lang.Object)
-	 */
-	public void declaratorId(Object declarator) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#declaratorAbort(java.lang.Object)
-	 */
-	public void declaratorAbort(Object declarator) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#declaratorPureVirtual(java.lang.Object)
-	 */
-	public void declaratorPureVirtual(Object declarator) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#declaratorCVModifier(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void declaratorCVModifier(Object declarator, IToken modifier) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#declaratorThrowsException(java.lang.Object)
-	 */
-	public void declaratorThrowsException(Object declarator) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#declaratorThrowExceptionName(java.lang.Object)
-	 */
-	public void declaratorThrowExceptionName(Object declarator) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#declaratorEnd(java.lang.Object)
-	 */
-	public void declaratorEnd(Object declarator) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#arrayDeclaratorBegin(java.lang.Object)
-	 */
-	public Object arrayDeclaratorBegin(Object declarator) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#arrayDeclaratorEnd(java.lang.Object)
-	 */
-	public void arrayDeclaratorEnd(Object arrayQualifier) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#pointerOperatorBegin(java.lang.Object)
-	 */
-	public Object pointerOperatorBegin(Object container) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#pointerOperatorType(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void pointerOperatorType(Object ptrOperator, IToken type) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#pointerOperatorName(java.lang.Object)
-	 */
-	public void pointerOperatorName(Object ptrOperator) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#pointerOperatorCVModifier(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void pointerOperatorCVModifier(Object ptrOperator, IToken modifier) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#pointerOperatorAbort(java.lang.Object)
-	 */
-	public void pointerOperatorAbort(Object ptrOperator) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#pointerOperatorEnd(java.lang.Object)
-	 */
-	public void pointerOperatorEnd(Object ptrOperator) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#argumentsBegin(java.lang.Object)
-	 */
-	public Object argumentsBegin(Object declarator) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#argumentsEnd(java.lang.Object)
-	 */
-	public void argumentsEnd(Object parameterDeclarationClause) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#functionBodyBegin(java.lang.Object)
-	 */
-	public Object functionBodyBegin(Object declaration) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#functionBodyEnd(java.lang.Object)
-	 */
-	public void functionBodyEnd(Object functionBody) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#classSpecifierBegin(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public Object classSpecifierBegin(Object container, IToken classKey) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#classSpecifierName(java.lang.Object)
-	 */
-	public void classSpecifierName(Object classSpecifier) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#classSpecifierAbort(java.lang.Object)
-	 */
-	public void classSpecifierAbort(Object classSpecifier) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#classMemberVisibility(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void classMemberVisibility(Object classSpecifier, IToken visibility) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#classSpecifierEnd(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void classSpecifierEnd(Object classSpecifier, IToken closingBrace) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#baseSpecifierBegin(java.lang.Object)
-	 */
-	public Object baseSpecifierBegin(Object containingClassSpec) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#baseSpecifierName(java.lang.Object)
-	 */
-	public void baseSpecifierName(Object baseSpecifier) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#baseSpecifierVisibility(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void baseSpecifierVisibility(Object baseSpecifier, IToken visibility) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#baseSpecifierVirtual(java.lang.Object, boolean)
-	 */
-	public void baseSpecifierVirtual(Object baseSpecifier, boolean virtual) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#baseSpecifierEnd(java.lang.Object)
-	 */
-	public void baseSpecifierEnd(Object baseSpecifier) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#expressionBegin(java.lang.Object)
-	 */
-	public Object expressionBegin(Object container) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#expressionOperator(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void expressionOperator(Object expression, IToken operator) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#expressionTerminal(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void expressionTerminal(Object expression, IToken terminal) {
-		// TODO Auto-generated method stub
-		
-	}
+}
 	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#expressionName(java.lang.Object)
+	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptAbstractTypeSpecDeclaration(org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration)
 	 */
-	public void expressionName(Object expression) {
+	public void acceptAbstractTypeSpecDeclaration(IASTAbstractTypeSpecifierDeclaration abstractDeclaration) {
 		// TODO Auto-generated method stub
 		
 	}
 	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#expressionAbort(java.lang.Object)
+	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptPointerToFunction(org.eclipse.cdt.core.parser.ast.IASTPointerToFunction)
 	 */
-	public void expressionAbort(Object expression) {
+	public void acceptPointerToFunction(IASTPointerToFunction function) {
 		// TODO Auto-generated method stub
 		
 	}
 	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#expressionEnd(java.lang.Object)
+	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptPointerToMethod(org.eclipse.cdt.core.parser.ast.IASTPointerToMethod)
 	 */
-	public void expressionEnd(Object expression) {
+	public void acceptPointerToMethod(IASTPointerToMethod method) {
 		// TODO Auto-generated method stub
 		
 	}
 	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#elaboratedTypeSpecifierBegin(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public Object elaboratedTypeSpecifierBegin(Object container, IToken classKey) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#elaboratedTypeSpecifierName(java.lang.Object)
+	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefReference(org.eclipse.cdt.core.parser.ast.IASTTypedefReference)
 	 */
-	public void elaboratedTypeSpecifierName(Object elab) {
+	public void acceptTypedefReference(IASTTypedefReference reference) {
 		// TODO Auto-generated method stub
 		
 	}
 	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#elaboratedTypeSpecifierEnd(java.lang.Object)
+	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptNamespaceReference(org.eclipse.cdt.core.parser.ast.IASTNamespaceReference)
 	 */
-	public void elaboratedTypeSpecifierEnd(Object elab) {
+	public void acceptNamespaceReference(IASTNamespaceReference reference) {
 		// TODO Auto-generated method stub
 		
 	}
 	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#namespaceDefinitionBegin(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
+	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference)
 	 */
-	public Object namespaceDefinitionBegin(Object container, IToken namespace) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#namespaceDefinitionId(java.lang.Object)
-	 */
-	public void namespaceDefinitionId(Object namespace) {
+	public void acceptEnumerationReference(IASTEnumerationReference reference) {
 		// TODO Auto-generated method stub
 		
 	}
 	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#namespaceDefinitionAbort(java.lang.Object)
+	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariableReference(org.eclipse.cdt.core.parser.ast.IASTVariableReference)
 	 */
-	public void namespaceDefinitionAbort(Object namespace) {
+	public void acceptVariableReference(IASTVariableReference reference) {
 		// TODO Auto-generated method stub
 		
 	}
 	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#namespaceDefinitionEnd(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
+	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionReference(org.eclipse.cdt.core.parser.ast.IASTFunctionReference)
 	 */
-	public void namespaceDefinitionEnd(Object namespace, IToken closingBrace) {
+	public void acceptFunctionReference(IASTFunctionReference reference) {
 		// TODO Auto-generated method stub
 		
 	}
 	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#linkageSpecificationBegin(java.lang.Object, java.lang.String)
-	 */
-	public Object linkageSpecificationBegin(Object container, String literal) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#linkageSpecificationEnd(java.lang.Object)
+	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFieldReference(org.eclipse.cdt.core.parser.ast.IASTFieldReference)
 	 */
-	public void linkageSpecificationEnd(Object linkageSpec) {
+	public void acceptFieldReference(IASTFieldReference reference) {
 		// TODO Auto-generated method stub
 		
 	}
 	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#usingDirectiveBegin(java.lang.Object)
+	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodReference(org.eclipse.cdt.core.parser.ast.IASTMethodReference)
 	 */
-	public Object usingDirectiveBegin(Object container) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#usingDirectiveNamespaceId(java.lang.Object)
-	 */
-	public void usingDirectiveNamespaceId(Object directive) {
+	public void acceptMethodReference(IASTMethodReference reference) {
 		// TODO Auto-generated method stub
 		
 	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#usingDirectiveAbort(java.lang.Object)
-	 */
-	public void usingDirectiveAbort(Object directive) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#usingDirectiveEnd(java.lang.Object)
-	 */
-	public void usingDirectiveEnd(Object directive) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#usingDeclarationBegin(java.lang.Object)
-	 */
-	public Object usingDeclarationBegin(Object container) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#usingDeclarationMapping(java.lang.Object, boolean)
-	 */
-	public void usingDeclarationMapping(Object declaration, boolean isTypeName) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#usingDeclarationAbort(java.lang.Object)
-	 */
-	public void usingDeclarationAbort(Object declaration) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#usingDeclarationEnd(java.lang.Object)
-	 */
-	public void usingDeclarationEnd(Object declaration) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#enumSpecifierBegin(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public Object enumSpecifierBegin(Object container, IToken enumKey) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#enumSpecifierId(java.lang.Object)
-	 */
-	public void enumSpecifierId(Object enumSpec) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#enumSpecifierAbort(java.lang.Object)
-	 */
-	public void enumSpecifierAbort(Object enumSpec) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#enumSpecifierEnd(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void enumSpecifierEnd(Object enumSpec, IToken closingBrace) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#enumeratorBegin(java.lang.Object)
-	 */
-	public Object enumeratorBegin(Object enumSpec) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#enumeratorId(java.lang.Object)
-	 */
-	public void enumeratorId(Object enumDefn) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#enumeratorEnd(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void enumeratorEnd(Object enumDefn, IToken lastToken) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#asmDefinition(java.lang.Object, java.lang.String)
-	 */
-	public void asmDefinition(Object container, String assemblyCode) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#constructorChainBegin(java.lang.Object)
-	 */
-	public Object constructorChainBegin(Object declarator) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#constructorChainAbort(java.lang.Object)
-	 */
-	public void constructorChainAbort(Object ctor) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#constructorChainEnd(java.lang.Object)
-	 */
-	public void constructorChainEnd(Object ctor) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#constructorChainElementBegin(java.lang.Object)
-	 */
-	public Object constructorChainElementBegin(Object ctor) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#constructorChainElementId(java.lang.Object)
-	 */
-	public void constructorChainElementId(Object element) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#constructorChainElementEnd(java.lang.Object)
-	 */
-	public void constructorChainElementEnd(Object element) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#constructorChainElementExpressionListElementBegin(java.lang.Object)
-	 */
-	public Object constructorChainElementExpressionListElementBegin(Object element) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#constructorChainElementExpressionListElementEnd(java.lang.Object)
-	 */
-	public void constructorChainElementExpressionListElementEnd(Object expression) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#explicitInstantiationBegin(java.lang.Object)
-	 */
-	public Object explicitInstantiationBegin(Object container) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#explicitInstantiationEnd(java.lang.Object)
-	 */
-	public void explicitInstantiationEnd(Object instantiation) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#explicitSpecializationBegin(java.lang.Object)
-	 */
-	public Object explicitSpecializationBegin(Object container) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#explicitSpecializationEnd(java.lang.Object)
-	 */
-	public void explicitSpecializationEnd(Object instantiation) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#templateDeclarationBegin(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public Object templateDeclarationBegin(Object container, IToken firstToken) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#templateDeclarationAbort(java.lang.Object)
-	 */
-	public void templateDeclarationAbort(Object templateDecl) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#templateDeclarationEnd(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public void templateDeclarationEnd(Object templateDecl, IToken lastToken) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#templateParameterListBegin(java.lang.Object)
-	 */
-	public Object templateParameterListBegin(Object declaration) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#templateParameterListEnd(java.lang.Object)
-	 */
-	public void templateParameterListEnd(Object parameterList) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#templateTypeParameterBegin(java.lang.Object, org.eclipse.cdt.core.parser.IToken)
-	 */
-	public Object templateTypeParameterBegin(Object templDecl, IToken kind) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#templateTypeParameterName(java.lang.Object)
-	 */
-	public void templateTypeParameterName(Object typeParm) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#templateTypeParameterAbort(java.lang.Object)
-	 */
-	public void templateTypeParameterAbort(Object typeParm) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#templateTypeParameterInitialTypeId(java.lang.Object)
-	 */
-	public void templateTypeParameterInitialTypeId(Object typeParm) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#templateTypeParameterEnd(java.lang.Object)
-	 */
-	public void templateTypeParameterEnd(Object typeParm) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#startBitfield(java.lang.Object)
-	 */
-	public Object startBitfield(Object declarator) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#endBitfield(java.lang.Object)
-	 */
-	public void endBitfield(Object bitfield) {
-		// TODO Auto-generated method stub
-		
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#oldKRParametersBegin(java.lang.Object)
-	 */
-	public Object oldKRParametersBegin(Object parameterDeclarationClause) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.IParserCallback#oldKRParametersEnd(java.lang.Object)
-	 */
-	public void oldKRParametersEnd(Object oldKRParameterDeclarationClause) {
-		// TODO Auto-generated method stub
-		
-	}
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptAbstractTypeSpecDeclaration(org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration)
-     */
-    public void acceptAbstractTypeSpecDeclaration(IASTAbstractTypeSpecifierDeclaration abstractDeclaration)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptPointerToFunction(org.eclipse.cdt.core.parser.ast.IASTPointerToFunction)
-     */
-    public void acceptPointerToFunction(IASTPointerToFunction function)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptPointerToMethod(org.eclipse.cdt.core.parser.ast.IASTPointerToMethod)
-     */
-    public void acceptPointerToMethod(IASTPointerToMethod method)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefReference(org.eclipse.cdt.core.parser.ast.IASTTypedefReference)
-     */
-    public void acceptTypedefReference(IASTTypedefReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptNamespaceReference(org.eclipse.cdt.core.parser.ast.IASTNamespaceReference)
-     */
-    public void acceptNamespaceReference(IASTNamespaceReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference)
-     */
-    public void acceptEnumerationReference(IASTEnumerationReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariableReference(org.eclipse.cdt.core.parser.ast.IASTVariableReference)
-     */
-    public void acceptVariableReference(IASTVariableReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionReference(org.eclipse.cdt.core.parser.ast.IASTFunctionReference)
-     */
-    public void acceptFunctionReference(IASTFunctionReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFieldReference(org.eclipse.cdt.core.parser.ast.IASTFieldReference)
-     */
-    public void acceptFieldReference(IASTFieldReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodReference(org.eclipse.cdt.core.parser.ast.IASTMethodReference)
-     */
-    public void acceptMethodReference(IASTMethodReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-//TODO: Get rid of these IParserCallbacks once the parser cleans up
-
 }
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/ChangeLog,v
retrieving revision 1.123
diff -u -r1.123 ChangeLog
--- ChangeLog	18 Jul 2003 16:39:26 -0000	1.123
+++ ChangeLog	21 Jul 2003 19:00:05 -0000
@@ -1,3 +1,9 @@
+2003-07-21	Bogdan Gheorghe
+	Update to CSearchResultLabelProvider to ensure that search labels
+	show up on subsequent runs.
+	
+	* src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java
+	* src/org/eclipse/cdt/internal/ui/search/CSearchResultLabelProvider.java
 2003-07-18  John Camelon
 	In the core, I updated ParserFactory.createScanner() to force the user to provide a callback and a ParserMode.
 	==> I had to update ComparatorModelBuilder.  
Index: src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java,v
retrieving revision 1.4
diff -u -r1.4 CSearchResultCollector.java
--- src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java	15 Jul 2003 14:43:48 -0000	1.4
+++ src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java	21 Jul 2003 19:00:06 -0000
@@ -163,7 +163,7 @@
 		}
 		
 		Image image = CUIPlugin.getImageDescriptorRegistry().get( imageDescriptor );
-		IMatch match = new Match(name, parentName, image, node.getElementNameOffset(), name.length() );
+		IMatch match = new Match(name, parentName, image, node.getNameOffset(), name.length() );
 		
 		return match;
 	}
Index: src/org/eclipse/cdt/internal/ui/search/CSearchResultLabelProvider.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchResultLabelProvider.java,v
retrieving revision 1.2
diff -u -r1.2 CSearchResultLabelProvider.java
--- src/org/eclipse/cdt/internal/ui/search/CSearchResultLabelProvider.java	15 Jul 2003 14:43:48 -0000	1.2
+++ src/org/eclipse/cdt/internal/ui/search/CSearchResultLabelProvider.java	21 Jul 2003 19:00:06 -0000
@@ -42,6 +42,7 @@
 	public static final String POTENTIAL_MATCH = CSearchMessages.getString("CSearchResultLabelProvider.potentialMatch"); //$NON-NLS-1$
 
 	public CSearchResultLabelProvider(){
+		_sortOrder = SHOW_ELEMENT_CONTAINER;
 		//_imageProvider = new CElementImageProvider();
 		//_labelProvider = new CElementLabelProvider();	
 	}

Back to the top