From ef856ea3e1e1acd7ffeac317801a531de0a75737 Mon Sep 17 00:00:00 2001 From: John Camelon Date: Tue, 23 Sep 2003 20:46:22 +0000 Subject: [PATCH] Patch for Hoda Amer Core: Solution to bug#43373: No reference to static member in definition (Major) Solution to bug#43371: constructor incorrectly marked private (Normal) Tests: Added CompleteParseASTTest.testBug43373() Added QuickParseASTTests.testBug43371() UI: Solution to bug#43143: Naming of Code Assist Menus/Tab are not consistent changed both names to Content Assist. No tests provided. --- core/org.eclipse.cdt.core.tests/ChangeLog | 4 + .../parser/tests/CompleteParseASTTest.java | 23 +++ .../core/parser/tests/QuickParseASTTests.java | 28 +++- .../internal/core/model/CModelBuilder.java | 21 ++- core/org.eclipse.cdt.core/parser/ChangeLog | 4 + .../cdt/core/parser/ast/IASTFactory.java | 2 +- .../core/parser/DeclarationWrapper.java | 1 - .../core/parser/ast/complete/ASTField.java | 4 +- .../core/parser/ast/complete/ASTVariable.java | 4 +- .../ast/complete/CompleteParseASTFactory.java | 141 ++++++++++++++++-- .../ast/quick/QuickParseASTFactory.java | 2 +- core/org.eclipse.cdt.ui/ChangeLog | 4 + .../ui/preferences/CEditorPreferencePage.java | 2 +- 13 files changed, 213 insertions(+), 27 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/ChangeLog b/core/org.eclipse.cdt.core.tests/ChangeLog index aa1fb33a822..4f3eb1b11e6 100644 --- a/core/org.eclipse.cdt.core.tests/ChangeLog +++ b/core/org.eclipse.cdt.core.tests/ChangeLog @@ -1,3 +1,7 @@ +2003-09-23 Hoda Amer + Added CompleteParseASTTest.testBug43373() + Added QuickParseASTTests.testBug43371() + 2003-09-22 Bogdan Gheorghe - modified CompletionProposalsTests, BaseSearchTest to avoid using isEnabled for the IndexManager diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java index 0d5f70339f5..f698a50fa72 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java @@ -773,5 +773,28 @@ public class CompleteParseASTTest extends CompleteParseBaseTest for( int j =0; j < 4; ++j ) assertFalse( classOp.getNameOffset() == ((IASTReference)callback.getReferences().get(j)).getOffset() ); } + /** + * class A { static int x; } int A::x = 5; + */ + public void testBug43373() throws Exception + { + try { // This is to prove that there are no exceptions + // Used to cause AST Semantic exception + Iterator i = parse( "class A { static int x; }; int A::x = 5;" ).getDeclarations(); + IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); + Iterator j = getDeclarations(classA); + IASTField field1 = (IASTField) j.next(); + // Note : this used to be considered a variable, not a field + IASTField field2 = (IASTField)i.next(); + + assertEquals( callback.getReferences().size(), 1 ); + Iterator references = callback.getReferences().iterator(); + assertEquals( ((IASTReference)references.next()).getReferencedElement(), classA ); + assertTrue (field1.getVisiblity() == field2.getVisiblity()); + }catch (Exception e){ + fail(); + } + } + } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java index 49d05221487..2a8dc9c7b7e 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java @@ -1815,5 +1815,31 @@ public class QuickParseASTTests extends BaseASTTest { parse("int *restrict ip_fn (void);", true, true, ParserLanguage.C).getDeclarations().next(); } - + /** + * Test code: struct Example { Example(); Example(int); ~Example();}; + * Purpose: tests a declaration in a class scope. + */ + public void testBug43371 () throws Exception + { + // Parse and get the translaton unit + Writer code = new StringWriter(); + code.write("struct Example { Example(); Example(int); ~Example();};"); + IASTCompilationUnit cu = parse(code.toString()); + Iterator i = cu.getDeclarations(); + assertTrue(i.hasNext()); + IASTAbstractTypeSpecifierDeclaration declaration = + (IASTAbstractTypeSpecifierDeclaration)i.next(); + assertFalse(i.hasNext()); + assertTrue( declaration.getTypeSpecifier() instanceof IASTClassSpecifier); + assertTrue(((IASTClassSpecifier)declaration.getTypeSpecifier()).getClassKind()== ASTClassKind.STRUCT); + Iterator j =((IASTClassSpecifier)declaration.getTypeSpecifier()).getDeclarations(); + assertTrue(j.hasNext()); + IASTMethod m1 = (IASTMethod)j.next(); + IASTMethod m2 = (IASTMethod)j.next(); + IASTMethod m3 = (IASTMethod)j.next(); + assertFalse(j.hasNext()); + assertTrue(m1.getVisiblity() == ASTAccessVisibility.PUBLIC); + assertTrue(m2.getVisiblity() == ASTAccessVisibility.PUBLIC); + assertTrue(m3.getVisiblity() == ASTAccessVisibility.PUBLIC); + } } \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java index 8128869a43b..ed629e6ee95 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java @@ -521,6 +521,10 @@ public class CModelBuilder { } } + methodElement.setParameterTypes(parameterTypes); + methodElement.setReturnType( ASTUtil.getType(functionDeclaration.getReturnType()) ); + methodElement.setStatic(functionDeclaration.isStatic()); + // Common settings for method declaration methodElement.setVisibility(methodDeclaration.getVisiblity()); methodElement.setVolatile(methodDeclaration.isVolatile()); @@ -535,15 +539,16 @@ public class CModelBuilder { } else // instance of IASTFunction { + FunctionDeclaration functionElement = null; if (functionDeclaration.hasFunctionBody()) { // function if(!isTemplate){ Function newElement = new Function( parent, name ); - element = newElement; + functionElement = newElement; } else { FunctionTemplate newElement = new FunctionTemplate( parent, name ); - element = newElement; + functionElement = newElement; } } else @@ -551,17 +556,17 @@ public class CModelBuilder { // functionDeclaration if(!isTemplate){ FunctionDeclaration newElement = new FunctionDeclaration( parent, name ); - element = newElement; + functionElement = newElement; } else { FunctionTemplate newElement = new FunctionTemplate( parent, name ); - element = newElement; + functionElement = newElement; } } + functionElement.setParameterTypes(parameterTypes); + functionElement.setReturnType( ASTUtil.getType(functionDeclaration.getReturnType()) ); + functionElement.setStatic(functionDeclaration.isStatic()); + element = functionElement; } - element.setParameterTypes(parameterTypes); - element.setReturnType( ASTUtil.getType(functionDeclaration.getReturnType()) ); - element.setStatic(functionDeclaration.isStatic()); - // add to parent parent.addChild( element ); diff --git a/core/org.eclipse.cdt.core/parser/ChangeLog b/core/org.eclipse.cdt.core/parser/ChangeLog index 5c749fc5bc4..1f4442ff994 100644 --- a/core/org.eclipse.cdt.core/parser/ChangeLog +++ b/core/org.eclipse.cdt.core/parser/ChangeLog @@ -1,3 +1,7 @@ +2003-09-23 Hoda Amer + Solution to bug#43373: No reference to static member in definition + Solution to bug#43371: constructor incorrectly marked private + 2003-09-18 Andrew Niefer - modified Symbol table interfaces to use Lists & Maps instead of LinkedList and HashMap - fixed warnings in ParserSymbolTable diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java index 3f22c73c0d4..963b8fcadba 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java @@ -147,7 +147,7 @@ public interface IASTFactory boolean isVolatile, boolean isVirtual, boolean isExplicit, - boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, boolean isDefinition ) throws ASTSemanticException; + boolean isPureVirtual, List constructorChain, boolean isDefinition ) throws ASTSemanticException; public IASTAbstractDeclaration createAbstractDeclaration( boolean isConst, boolean isVolatile, diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java index f0a5c6e1792..00f78e46765 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java @@ -468,7 +468,6 @@ public class DeclarationWrapper implements IDeclaratorOwner virtual, explicit, declarator.isPureVirtual(), - ASTAccessVisibility.PUBLIC, declarator.getConstructorMemberInitializers(), declarator.hasFunctionBody() ); } /** diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTField.java index 3c808db9084..1bc2170b929 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTField.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTField.java @@ -37,9 +37,9 @@ public class ASTField extends ASTVariable implements IASTField * @param references * @param visibility */ - public ASTField(ISymbol newSymbol, IASTAbstractDeclaration abstractDeclaration, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, int startingOffset, int nameOffset, List references, IASTExpression constructorExpression, ASTAccessVisibility visibility) + public ASTField(ISymbol newSymbol, IASTAbstractDeclaration abstractDeclaration, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, int startingOffset, int nameOffset, List references, boolean previouslyDeclared, IASTExpression constructorExpression, ASTAccessVisibility visibility) { - super( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, constructorExpression ); + super( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, constructorExpression, previouslyDeclared ); this.visibility = visibility; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariable.java index 58763f2a3e0..397e7732441 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariable.java @@ -29,6 +29,7 @@ import org.eclipse.cdt.internal.core.parser.pst.TypeInfo; */ public class ASTVariable extends ASTSymbol implements IASTVariable { + private final boolean previouslyDeclared; private final IASTExpression constructorExpression; protected final ASTReferenceStore referenceDelegate; private final ASTQualifiedNamedElement qualifiedName; @@ -45,7 +46,7 @@ public class ASTVariable extends ASTSymbol implements IASTVariable * @param nameOffset * @param references */ - public ASTVariable(ISymbol newSymbol, IASTAbstractDeclaration abstractDeclaration, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, int startingOffset, int nameOffset, List references, IASTExpression constructorExpression ) + public ASTVariable(ISymbol newSymbol, IASTAbstractDeclaration abstractDeclaration, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, int startingOffset, int nameOffset, List references, IASTExpression constructorExpression, boolean previouslyDeclared ) { super( newSymbol ); this.abstractDeclaration = abstractDeclaration; @@ -56,6 +57,7 @@ public class ASTVariable extends ASTSymbol implements IASTVariable setNameOffset( nameOffset ); referenceDelegate = new ASTReferenceStore( references ); qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), newSymbol.getName() ); + this.previouslyDeclared =previouslyDeclared; } /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isAuto() diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java index 7fab83a2d94..a8833ec1c7f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java @@ -157,6 +157,10 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto return result; } + protected ISymbol lookupQualifiedName( IContainerSymbol startingScope, String name, List references, boolean throwOnError ) throws ASTSemanticException{ + return lookupQualifiedName(startingScope, name, TypeInfo.t_any, null, 0, references, throwOnError); + } + protected ISymbol lookupQualifiedName( IContainerSymbol startingScope, String name, TypeInfo.eType type, List parameters, int offset, List references, boolean throwOnError ) throws ASTSemanticException { ISymbol result = null; @@ -1406,7 +1410,8 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto boolean isVirtual, boolean isExplicit, boolean isPureVirtual, - ASTAccessVisibility visibility, List constructorChain, boolean isFunctionDefinition ) throws ASTSemanticException + List constructorChain, + boolean isFunctionDefinition ) throws ASTSemanticException { List references = new ArrayList(); IContainerSymbol ownerScope = scopeToSymbol( scope ); @@ -1437,7 +1442,12 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto if(parentSymbol == null){ parentSymbol = (IContainerSymbol) lookupQualifiedName(parentScope, token, TypeInfo.t_namespace, null, offset, references, false); } - if(parentSymbol == null) + if(parentSymbol == null){ + parentSymbol = (IContainerSymbol) lookupQualifiedName(parentScope, token, TypeInfo.t_struct, null, offset, references, false); + } + if(parentSymbol == null){ + parentSymbol = (IContainerSymbol) lookupQualifiedName(parentScope, token, TypeInfo.t_union, null, offset, references, false); + } if(parentSymbol == null) break; else { parentScope = parentSymbol; @@ -1445,12 +1455,16 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto } } - if((parentScope != null) && (parentScope.getType() == TypeInfo.t_class)){ - IASTClassSpecifier methodParentScope = (IASTClassSpecifier)parentScope.getASTExtension().getPrimaryDeclaration(); + if((parentScope != null) && + ( (parentScope.getType() == TypeInfo.t_class) + || (parentScope.getType() == TypeInfo.t_struct) + || (parentScope.getType() == TypeInfo.t_union)) + ){ + IASTScope methodParentScope = (IASTScope)parentScope.getASTExtension().getPrimaryDeclaration(); return createMethod(methodParentScope, functionName,nameEndOffset, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, offset, ownerTemplate, isConst, isVolatile, isVirtual, isExplicit, isPureVirtual, - visibility, constructorChain, references, isFunctionDefinition); + ASTAccessVisibility.PRIVATE, constructorChain, references, isFunctionDefinition); } } @@ -1852,6 +1866,59 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto int nameOffset, IASTExpression constructorExpression) throws ASTSemanticException { List references = new ArrayList(); + IContainerSymbol ownerScope = scopeToSymbol( scope ); + + // check if this is a scoped field, not a variable + StringTokenizer tokenizer = new StringTokenizer(name,DOUBLE_COLON); + int tokencount = tokenizer.countTokens(); + if(tokencount > 1){ + List tokens = new ArrayList(); + String oneToken = ""; + // This is NOT a function. This is a method definition + while (tokenizer.hasMoreTokens()){ + oneToken = tokenizer.nextToken(); + tokens.add(oneToken); + } + + String fieldName = oneToken; + String parentName = name.substring(0, name.lastIndexOf(DOUBLE_COLON)); + + int numOfTokens = 1; + int offset = nameOffset; + IContainerSymbol parentScope = ownerScope; + Iterator i = tokens.iterator(); + while (i.hasNext() && (numOfTokens++) < tokens.size()){ + String token = (String) i.next(); + IContainerSymbol parentSymbol = + (IContainerSymbol) lookupQualifiedName(parentScope, token, TypeInfo.t_class, null, offset, references, false); + if(parentSymbol == null){ + parentSymbol = (IContainerSymbol) lookupQualifiedName(parentScope, token, TypeInfo.t_namespace, null, offset, references, false); + } + if(parentSymbol == null){ + parentSymbol = (IContainerSymbol) lookupQualifiedName(parentScope, token, TypeInfo.t_struct, null, offset, references, false); + } + if(parentSymbol == null){ + parentSymbol = (IContainerSymbol) lookupQualifiedName(parentScope, token, TypeInfo.t_union, null, offset, references, false); + } + if(parentSymbol == null) + break; + else { + parentScope = parentSymbol; + offset += token.length()+ DOUBLE_COLON.length(); + } + } + + if((parentScope != null) && + ( (parentScope.getType() == TypeInfo.t_class) + || (parentScope.getType() == TypeInfo.t_struct) + || (parentScope.getType() == TypeInfo.t_union)) + ){ + IASTScope fieldParentScope = (IASTScope)parentScope.getASTExtension().getPrimaryDeclaration(); + return createField(fieldParentScope, fieldName,isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, + isRegister, isStatic, startingOffset, offset, constructorExpression, ASTAccessVisibility.PRIVATE, references); + } + } + ISymbol newSymbol = cloneSimpleTypeSymbol(name, abstractDeclaration, references); setVariableTypeInfoBits( isAuto, @@ -1862,16 +1929,28 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto isStatic, newSymbol); setPointerOperators( newSymbol, abstractDeclaration.getPointerOperators(), abstractDeclaration.getArrayModifiers() ); + + newSymbol.setIsForwardDeclaration(isStatic); + boolean previouslyDeclared = false; + if(!isStatic){ + ISymbol variableDeclaration = (ISymbol) lookupQualifiedName(ownerScope, name, new ArrayList(), false); + + if( variableDeclaration != null ) + { + variableDeclaration.setTypeSymbol( newSymbol ); + previouslyDeclared = true; + } + } try { - scopeToSymbol(scope).addSymbol( newSymbol ); + ownerScope.addSymbol( newSymbol ); } catch (ParserSymbolTableException e) { // TODO Auto-generated catch block } - ASTVariable variable = new ASTVariable( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, constructorExpression ); + ASTVariable variable = new ASTVariable( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, constructorExpression, previouslyDeclared ); try { attachSymbolExtension(newSymbol, variable ); @@ -1931,6 +2010,25 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createField(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, boolean, org.eclipse.cdt.core.parser.ast.IASTInitializerClause, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, boolean, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility) */ + public IASTField createField( + IASTScope scope, + String name, + boolean isAuto, + IASTInitializerClause initializerClause, + IASTExpression bitfieldExpression, + IASTAbstractDeclaration abstractDeclaration, + boolean isMutable, + boolean isExtern, + boolean isRegister, + boolean isStatic, + int startingOffset, + int nameOffset, + IASTExpression constructorExpression, ASTAccessVisibility visibility) throws ASTSemanticException + { + return createField(scope, name,isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, + isRegister, isStatic, startingOffset, nameOffset, constructorExpression, visibility, null); + } + public IASTField createField( IASTScope scope, String name, @@ -1944,9 +2042,14 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto boolean isStatic, int startingOffset, int nameOffset, - IASTExpression constructorExpression, ASTAccessVisibility visibility) throws ASTSemanticException + IASTExpression constructorExpression, + ASTAccessVisibility visibility, + List references) throws ASTSemanticException { - List references = new ArrayList(); + IContainerSymbol ownerScope = scopeToSymbol( scope ); + + if(references == null) + references = new ArrayList(); ISymbol newSymbol = cloneSimpleTypeSymbol(name, abstractDeclaration, references); setVariableTypeInfoBits( isAuto, @@ -1958,16 +2061,32 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto newSymbol); setPointerOperators( newSymbol, abstractDeclaration.getPointerOperators(), abstractDeclaration.getArrayModifiers() ); + newSymbol.setIsForwardDeclaration(isStatic); + boolean previouslyDeclared = false; + if(!isStatic){ + List fieldReferences = new ArrayList(); + ISymbol fieldDeclaration = lookupQualifiedName(ownerScope, name, fieldReferences, false); + + if( fieldDeclaration != null ) + { + previouslyDeclared = true; + fieldDeclaration.setTypeSymbol( newSymbol ); + // set the definition visibility = declaration visibility + ASTReference reference = (ASTReference) fieldReferences.iterator().next(); + visibility = ((IASTField)reference.getReferencedElement()).getVisiblity(); + } + } + try { - scopeToSymbol(scope).addSymbol( newSymbol ); + ownerScope.addSymbol( newSymbol ); } catch (ParserSymbolTableException e) { throw new ASTSemanticException(); } - ASTField field = new ASTField( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, constructorExpression, visibility ); + ASTField field = new ASTField( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, references, previouslyDeclared, constructorExpression, visibility ); try { attachSymbolExtension(newSymbol, field ); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java index fad3cac929c..2db44c8eaca 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java @@ -188,7 +188,7 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createFunction(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) */ - public IASTFunction createFunction(IASTScope scope, String name, int nameEndOffset, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, boolean isFunctionDefinition ) + public IASTFunction createFunction(IASTScope scope, String name, int nameEndOffset, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, List constructorChain, boolean isFunctionDefinition ) { return new ASTFunction(scope, name, nameEndOffset, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, ownerTemplate ); } diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog index 8f51e67c2d4..4be21f7df51 100644 --- a/core/org.eclipse.cdt.ui/ChangeLog +++ b/core/org.eclipse.cdt.ui/ChangeLog @@ -10,6 +10,10 @@ * src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java * src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java +2003-09-23 Hoda Amer + Solution to bug#43143: Naming of Code Assist Menus/Tab are not consistent + changed both names to Content Assist. No tests provided. + 2003-09-22 Bogdan Gheorghe Got rid of the C/C++ Project property page (only the indexer tab was left). Here are the changes: diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java index b7d523830d1..77a92ee4e05 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java @@ -950,7 +950,7 @@ public class CEditorPreferencePage extends PreferencePage implements IWorkbenchP item.setControl(createColorPage(folder)); item = new TabItem(folder, SWT.NONE); - item.setText("Code A&ssist"); + item.setText("Content A&ssist"); item.setImage(CPluginImages.get(CPluginImages.IMG_OBJS_TUNIT)); item.setControl(createContentAssistPage(folder));