diff --git a/core/org.eclipse.cdt.core/parser/ChangeLog-parser b/core/org.eclipse.cdt.core/parser/ChangeLog-parser index fd700f376b8..63658aa6af9 100644 --- a/core/org.eclipse.cdt.core/parser/ChangeLog-parser +++ b/core/org.eclipse.cdt.core/parser/ChangeLog-parser @@ -1,3 +1,7 @@ +2004-01-29 John Camelon + Fixed 50642 - Wrong completion kind when declaring an argument type + Updated using declarations for more accurate keywords and closure. + 2004-01-29 Hoda Amer Put CompletionKind.FUNCTION_REFERENCE back. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java index 61e99eee98c..10bf209fd55 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java @@ -301,13 +301,16 @@ public abstract class Parser implements IParser else { boolean typeName = false; + setCompletionValues(scope, CompletionKind.TYPE_REFERENCE, Key.POST_USING ); + if (LT(1) == IToken.t_typename) { typeName = true; consume(IToken.t_typename); } - setCompletionValues(scope, CompletionKind.TYPE_REFERENCE, Key.EMPTY ); + + setCompletionValues(scope, CompletionKind.TYPE_REFERENCE, Key.NAMESPACE_ONLY ); TokenDuple name = null; if (LT(1) == IToken.tIDENTIFIER || LT(1) == IToken.tCOLONCOLON) { @@ -337,6 +340,7 @@ public abstract class Parser implements IParser throw backtrack; } declaration.acceptElement( requestor ); + setCompletionValues(scope, getCompletionKindForDeclaration(scope, null), Key.DECLARATION ); } else { @@ -1178,7 +1182,7 @@ public abstract class Parser implements IParser throws BacktrackException, EndOfFileException { IToken current = LA(1); - + DeclarationWrapper sdw = new DeclarationWrapper(scope, current.getOffset(), current.getLineNumber(), null); declSpecifierSeq(sdw, true, false); @@ -1206,6 +1210,7 @@ public abstract class Parser implements IParser throw backtrack; } + setCompletionValues(scope,CompletionKind.USER_SPECIFIED_NAME,Key.EMPTY ); if (LT(1) != IToken.tSEMI) initDeclarator(sdw, SimpleDeclarationStrategy.TRY_FUNCTION ); @@ -2188,11 +2193,11 @@ public abstract class Parser implements IParser { case IToken.tLPAREN : + boolean failed = false; // temporary fix for initializer/function declaration ambiguity - if (!LA(2).looksLikeExpression() && strategy != SimpleDeclarationStrategy.TRY_VARIABLE ) + if ( queryLookaheadCapability(2) && !LA(2).looksLikeExpression() && strategy != SimpleDeclarationStrategy.TRY_VARIABLE ) { - boolean failed = false; - if( LT(2) == IToken.tIDENTIFIER ) + if( LT(2) == IToken.tIDENTIFIER ) { IToken newMark = mark(); consume( IToken.tLPAREN ); @@ -2215,138 +2220,141 @@ public abstract class Parser implements IParser backup( newMark ); } - if( !failed ) - { - // parameterDeclarationClause - d.setIsFunction(true); - // TODO need to create a temporary scope object here - consume(IToken.tLPAREN); - boolean seenParameter = false; - parameterDeclarationLoop : for (;;) - { - switch (LT(1)) - { - case IToken.tRPAREN : - consume(); - break parameterDeclarationLoop; - case IToken.tELLIPSIS : - consume(); - d.setIsVarArgs( true ); - break; - case IToken.tCOMMA : - consume(); - seenParameter = false; - break; - default : - if (seenParameter) - throw backtrack; - parameterDeclaration(d, scope); - seenParameter = true; - } - } - } + } + if( ( queryLookaheadCapability(2) && !LA(2).looksLikeExpression() && strategy != SimpleDeclarationStrategy.TRY_VARIABLE && !failed) || ! queryLookaheadCapability(3) ) + { + // parameterDeclarationClause + d.setIsFunction(true); + // TODO need to create a temporary scope object here + consume(IToken.tLPAREN); + setCompletionValues( scope, CompletionKind.ARGUMENT_TYPE, Key.DECL_SPECIFIER_SEQUENCE ); + boolean seenParameter = false; + parameterDeclarationLoop : for (;;) + { + switch (LT(1)) + { + case IToken.tRPAREN : + consume(); + setCompletionValues( scope, CompletionKind.NO_SUCH_KIND, KeywordSets.Key.FUNCTION_MODIFIER ); + break parameterDeclarationLoop; + case IToken.tELLIPSIS : + consume(); + d.setIsVarArgs( true ); + break; + case IToken.tCOMMA : + consume(); + setCompletionValues( scope, CompletionKind.ARGUMENT_TYPE, Key.DECL_SPECIFIER_SEQUENCE ); + seenParameter = false; + break; + default : + if (seenParameter) + throw backtrack; + parameterDeclaration(d, scope); + seenParameter = true; + } + } + } - if (LT(1) == IToken.tCOLON || LT(1) == IToken.t_try ) - break overallLoop; - - IToken beforeCVModifier = mark(); - IToken cvModifier = null; - IToken afterCVModifier = beforeCVModifier; - // const-volatile - // 2 options: either this is a marker for the method, - // or it might be the beginning of old K&R style parameter declaration, see - // void getenv(name) const char * name; {} - // This will be determined further below - if (LT(1) == IToken.t_const - || LT(1) == IToken.t_volatile) + if (LT(1) == IToken.tCOLON || LT(1) == IToken.t_try ) + break overallLoop; + + IToken beforeCVModifier = mark(); + IToken cvModifier = null; + IToken afterCVModifier = beforeCVModifier; + // const-volatile + // 2 options: either this is a marker for the method, + // or it might be the beginning of old K&R style parameter declaration, see + // void getenv(name) const char * name; {} + // This will be determined further below + if (LT(1) == IToken.t_const + || LT(1) == IToken.t_volatile) + { + cvModifier = consume(); + afterCVModifier = mark(); + } + //check for throws clause here + List exceptionSpecIds = null; + if (LT(1) == IToken.t_throw) + { + exceptionSpecIds = new ArrayList(); + consume(); // throw + consume(IToken.tLPAREN); // ( + boolean done = false; + IASTTypeId duple = null; + while (!done) { - cvModifier = consume(); - afterCVModifier = mark(); - } - //check for throws clause here - List exceptionSpecIds = null; - if (LT(1) == IToken.t_throw) - { - exceptionSpecIds = new ArrayList(); - consume(); // throw - consume(IToken.tLPAREN); // ( - boolean done = false; - IASTTypeId duple = null; - while (!done) + switch (LT(1)) { - switch (LT(1)) - { - case IToken.tRPAREN : + case IToken.tRPAREN : + consume(); + done = true; + break; + case IToken.tCOMMA : + consume(); + break; + default : + String image = LA(1).getImage(); + try + { + duple = typeId(scope, false); + exceptionSpecIds.add(duple); + } + catch (BacktrackException e) + { + failParse(); + log.traceLog( + "Unexpected Token =" + + image ); consume(); - done = true; - break; - case IToken.tCOMMA : - consume(); - break; - default : - String image = LA(1).getImage(); - try - { - duple = typeId(scope, false); - exceptionSpecIds.add(duple); - } - catch (BacktrackException e) - { - failParse(); - log.traceLog( - "Unexpected Token =" - + image ); - consume(); - // eat this token anyway - continue; - } - break; - } + // eat this token anyway + continue; + } + break; } - if (exceptionSpecIds != null) - try - { - d.setExceptionSpecification( - astFactory - .createExceptionSpecification( - d.getDeclarationWrapper().getScope(), exceptionSpecIds)); - } - catch (ASTSemanticException e) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } } - // check for optional pure virtual - if (LT(1) == IToken.tASSIGN - && LT(2) == IToken.tINTEGER - && LA(2).getImage().equals("0")) - { - consume(IToken.tASSIGN); - consume(IToken.tINTEGER); - d.setPureVirtual(true); - } - if (afterCVModifier != LA(1) - || LT(1) == IToken.tSEMI) - { - // There were C++-specific clauses after const/volatile modifier - // Then it is a marker for the method - if (cvModifier != null) + if (exceptionSpecIds != null) + try { - - if (cvModifier.getType() == IToken.t_const) - d.setConst(true); - if (cvModifier.getType() - == IToken.t_volatile) - d.setVolatile(true); + d.setExceptionSpecification( + astFactory + .createExceptionSpecification( + d.getDeclarationWrapper().getScope(), exceptionSpecIds)); } - afterCVModifier = mark(); - // In this case (method) we can't expect K&R parameter declarations, - // but we'll check anyway, for errorhandling + catch (ASTSemanticException e) + { + failParse(); + throw backtrack; + } catch (Exception e) + { + throw backtrack; + } + } + // check for optional pure virtual + if (LT(1) == IToken.tASSIGN + && LT(2) == IToken.tINTEGER + && LA(2).getImage().equals("0")) + { + consume(IToken.tASSIGN); + consume(IToken.tINTEGER); + d.setPureVirtual(true); + } + if (afterCVModifier != LA(1) + || LT(1) == IToken.tSEMI) + { + // There were C++-specific clauses after const/volatile modifier + // Then it is a marker for the method + if (cvModifier != null) + { + + if (cvModifier.getType() == IToken.t_const) + d.setConst(true); + if (cvModifier.getType() + == IToken.t_volatile) + d.setVolatile(true); } + afterCVModifier = mark(); + // In this case (method) we can't expect K&R parameter declarations, + // but we'll check anyway, for errorhandling } break; case IToken.tLBRACKET : diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/token/KeywordSets.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/token/KeywordSets.java index 39445266f00..a6ad4759532 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/token/KeywordSets.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/token/KeywordSets.java @@ -33,6 +33,8 @@ public class KeywordSets { public static final Key STATEMENT = new Key(3); public static final Key BASE_SPECIFIER = new Key(4); public static final Key POST_USING = new Key( 5 ); + public static final Key FUNCTION_MODIFIER = new Key( 6 ); + public static final Key NAMESPACE_ONLY = new Key(6); /** * @param enumValue */ @@ -56,6 +58,10 @@ public class KeywordSets { return BASE_SPECIFIER_CPP; if( kind == Key.POST_USING ) return POST_USING_CPP; + if( kind == Key.FUNCTION_MODIFIER ) + return (Set) FUNCTION_MODIFIER.get( language ); + if( kind == Key.NAMESPACE_ONLY ) + return NAMESPACE_ONLY; //TODO finish this return null; @@ -63,6 +69,13 @@ public class KeywordSets { private static final Set EMPTY = new HashSet(); + private static final Set NAMESPACE_ONLY; + static + { + NAMESPACE_ONLY = new HashSet(); + NAMESPACE_ONLY.add(Keywords.NAMESPACE ); + } + private static final Set DECL_SPECIFIER_SEQUENCE_C; static { @@ -188,5 +201,28 @@ public class KeywordSets { POST_USING_CPP = new TreeSet(); POST_USING_CPP.add(Keywords.NAMESPACE); POST_USING_CPP.add(Keywords.TYPENAME); - } + } + + private static final Set FUNCTION_MODIFIER_C; + static + { + FUNCTION_MODIFIER_C = new TreeSet(); + } + private static final Set FUNCTION_MODIFIER_CPP; + static + { + FUNCTION_MODIFIER_CPP = new TreeSet( FUNCTION_MODIFIER_C ); + FUNCTION_MODIFIER_CPP.add( Keywords.CONST ); + FUNCTION_MODIFIER_CPP.add( Keywords.THROW); + FUNCTION_MODIFIER_CPP.add( Keywords.TRY ); + FUNCTION_MODIFIER_CPP.add( Keywords.VOLATILE ); + } + + private static final Hashtable FUNCTION_MODIFIER; + static + { + FUNCTION_MODIFIER= new Hashtable(); + FUNCTION_MODIFIER.put( ParserLanguage.CPP, FUNCTION_MODIFIER_CPP ); + FUNCTION_MODIFIER.put( ParserLanguage.C, FUNCTION_MODIFIER_C ); + } } diff --git a/core/org.eclipse.cdt.ui.tests/ChangeLog b/core/org.eclipse.cdt.ui.tests/ChangeLog index 30b9ed129e9..f9e3c873920 100644 --- a/core/org.eclipse.cdt.ui.tests/ChangeLog +++ b/core/org.eclipse.cdt.ui.tests/ChangeLog @@ -1,3 +1,9 @@ +2004-01-29 John Camelon + Updated CompletionTest_ArgumentType_Prefix_Bug50642, renamed it to CompletionTest_ArgumentType_Prefix and moved to passed test package. + Updated CompletionTest_ArgumentType_Prefix2_Bug50642, renamed it to CompletionTest_ArgumentType_Prefix2 and moved to passed test package. + Updated CompletionTest_ArgumentType_NoPrefix_Bug50642, renamed it to CompletionTest_ArgumentType_NoPrefix and moved to passed test package. + Updated CompletionTest_ArgumentType_NoPrefix2_Bug50642, renamed it to CompletionTest_ArgumentType_NoPrefix2 and moved to passed test package. + 2004-01-29 Hoda Amer Added two more tests, namely Function_Reference and Constructor_Reference. Moved tests starts resources all to one directory. diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java index f0ff1a2963c..10db34c2b60 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java @@ -42,10 +42,10 @@ public class AutomatedSuite extends TestSuite { addTest(CompletionTest_FieldType_NoPrefix2.suite()); addTest(CompletionTest_VariableType_Prefix.suite()); addTest(CompletionTest_VariableType_NoPrefix.suite()); - addTest(CompletionTest_ArgumentType_NoPrefix_Bug50642.suite()); - addTest(CompletionTest_ArgumentType_NoPrefix2_Bug50642.suite()); - addTest(CompletionTest_ArgumentType_Prefix_Bug50642.suite()); - addTest(CompletionTest_ArgumentType_NoPrefix2_Bug50642.suite()); + addTest(CompletionTest_ArgumentType_NoPrefix.suite()); + addTest(CompletionTest_ArgumentType_NoPrefix2.suite()); + addTest(CompletionTest_ArgumentType_Prefix.suite()); + addTest(CompletionTest_ArgumentType_NoPrefix2.suite()); addTest(CompletionTest_SingleName_Method_Prefix.suite()); addTest(CompletionTest_SingleName_Method_NoPrefix.suite()); addTest(CompletionTest_SingleName_Prefix.suite()); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix_Bug50642.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/CompletionTest_ArgumentType_NoPrefix.java similarity index 85% rename from core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix_Bug50642.java rename to core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/CompletionTest_ArgumentType_NoPrefix.java index 1eda49714ee..c6a549b6483 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix_Bug50642.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/CompletionTest_ArgumentType_NoPrefix.java @@ -8,14 +8,13 @@ * Contributors: * IBM Rational Software - Initial API and implementation ***********************************************************************/ -package org.eclipse.cdt.ui.tests.text.contentassist.failedtests; +package org.eclipse.cdt.ui.tests.text.contentassist; import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind; -import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest; /** * @author hamer @@ -24,25 +23,25 @@ import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest; * Bug#50642 : Wrong completion kind when declaring an argument type * */ -public class CompletionTest_ArgumentType_NoPrefix_Bug50642 extends CompletionProposalsBaseTest{ +public class CompletionTest_ArgumentType_NoPrefix extends CompletionProposalsBaseTest{ private final String fileName = "CompletionTestStart17.cpp"; private final String fileFullPath ="resources/contentassist/" + fileName; private final String headerFileName = "CompletionTestStart.h"; private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedScopeName = "ASTCompilationUnit"; private final String expectedContextName = "null"; - private final CompletionKind expectedKind = CompletionKind.VARIABLE_TYPE; // should be CompletionKind.ARGUMENT_TYPE; + private final CompletionKind expectedKind = CompletionKind.ARGUMENT_TYPE; private final String expectedPrefix = ""; private final String[] expectedResults = { }; - public CompletionTest_ArgumentType_NoPrefix_Bug50642(String name) { + public CompletionTest_ArgumentType_NoPrefix(String name) { super(name); } public static Test suite() { - TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix_Bug50642.class.getName()); - suite.addTest(new CompletionTest_ArgumentType_NoPrefix_Bug50642("testCompletionProposals")); + TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix.class.getName()); + suite.addTest(new CompletionTest_ArgumentType_NoPrefix("testCompletionProposals")); return suite; } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix2_Bug50642.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/CompletionTest_ArgumentType_NoPrefix2.java similarity index 85% rename from core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix2_Bug50642.java rename to core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/CompletionTest_ArgumentType_NoPrefix2.java index b056c9f72e1..54cbcda4453 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix2_Bug50642.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/CompletionTest_ArgumentType_NoPrefix2.java @@ -8,13 +8,12 @@ * Contributors: * IBM Rational Software - Initial API and implementation ***********************************************************************/ -package org.eclipse.cdt.ui.tests.text.contentassist.failedtests; +package org.eclipse.cdt.ui.tests.text.contentassist; import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind; -import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest; /** * @author hamer @@ -23,25 +22,25 @@ import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest; * Bug#50642 : Wrong completion kind when declaring an argument type * */ -public class CompletionTest_ArgumentType_NoPrefix2_Bug50642 extends CompletionProposalsBaseTest{ +public class CompletionTest_ArgumentType_NoPrefix2 extends CompletionProposalsBaseTest{ private final String fileName = "CompletionTestStart19.cpp"; private final String fileFullPath ="resources/contentassist/" + fileName; private final String headerFileName = "CompletionTestStart.h"; private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedScopeName = "ASTClassSpecifier"; private final String expectedContextName = "null"; - private final CompletionKind expectedKind = CompletionKind.FIELD_TYPE; // should be CompletionKind.ARGUMENT_TYPE; + private final CompletionKind expectedKind = CompletionKind.ARGUMENT_TYPE; private final String expectedPrefix = ""; private final String[] expectedResults = { }; - public CompletionTest_ArgumentType_NoPrefix2_Bug50642(String name) { + public CompletionTest_ArgumentType_NoPrefix2(String name) { super(name); } public static Test suite() { - TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix2_Bug50642.class.getName()); - suite.addTest(new CompletionTest_ArgumentType_NoPrefix2_Bug50642("testCompletionProposals")); + TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix2.class.getName()); + suite.addTest(new CompletionTest_ArgumentType_NoPrefix2("testCompletionProposals")); return suite; } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix_Bug50642.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/CompletionTest_ArgumentType_Prefix.java similarity index 86% rename from core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix_Bug50642.java rename to core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/CompletionTest_ArgumentType_Prefix.java index 995be0aa25d..8968d804d7c 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix_Bug50642.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/CompletionTest_ArgumentType_Prefix.java @@ -8,13 +8,12 @@ * Contributors: * IBM Rational Software - Initial API and implementation ***********************************************************************/ -package org.eclipse.cdt.ui.tests.text.contentassist.failedtests; +package org.eclipse.cdt.ui.tests.text.contentassist; import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind; -import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest; /** * @author hamer @@ -23,14 +22,14 @@ import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest; * Bug#50642 : Wrong completion kind when declaring an argument type * */ -public class CompletionTest_ArgumentType_Prefix_Bug50642 extends CompletionProposalsBaseTest{ +public class CompletionTest_ArgumentType_Prefix extends CompletionProposalsBaseTest{ private final String fileName = "CompletionTestStart16.cpp"; private final String fileFullPath ="resources/contentassist/" + fileName; private final String headerFileName = "CompletionTestStart.h"; private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedScopeName = "ASTCompilationUnit"; private final String expectedContextName = "null"; - private final CompletionKind expectedKind = CompletionKind.VARIABLE_TYPE; // should be CompletionKind.ARGUMENT_TYPE; + private final CompletionKind expectedKind = CompletionKind.ARGUMENT_TYPE; private final String expectedPrefix = "a"; private final String[] expectedResults = { "aClass", @@ -40,13 +39,13 @@ public class CompletionTest_ArgumentType_Prefix_Bug50642 extends CompletionProp "AStruct" }; - public CompletionTest_ArgumentType_Prefix_Bug50642(String name) { + public CompletionTest_ArgumentType_Prefix(String name) { super(name); } public static Test suite() { - TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix_Bug50642.class.getName()); - suite.addTest(new CompletionTest_ArgumentType_Prefix_Bug50642("testCompletionProposals")); + TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix.class.getName()); + suite.addTest(new CompletionTest_ArgumentType_Prefix("testCompletionProposals")); return suite; } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix2_Bug50642.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/CompletionTest_ArgumentType_Prefix2.java similarity index 86% rename from core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix2_Bug50642.java rename to core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/CompletionTest_ArgumentType_Prefix2.java index bd3db81952a..3df8457c6fa 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix2_Bug50642.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/CompletionTest_ArgumentType_Prefix2.java @@ -8,13 +8,12 @@ * Contributors: * IBM Rational Software - Initial API and implementation ***********************************************************************/ -package org.eclipse.cdt.ui.tests.text.contentassist.failedtests; +package org.eclipse.cdt.ui.tests.text.contentassist; import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind; -import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest; /** * @author hamer @@ -23,14 +22,14 @@ import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest; * Bug#50642 : Wrong completion kind when declaring an argument type * */ -public class CompletionTest_ArgumentType_Prefix2_Bug50642 extends CompletionProposalsBaseTest{ +public class CompletionTest_ArgumentType_Prefix2 extends CompletionProposalsBaseTest{ private final String fileName = "CompletionTestStart18.cpp"; private final String fileFullPath ="resources/contentassist/" + fileName; private final String headerFileName = "CompletionTestStart.h"; private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedScopeName = "ASTClassSpecifier"; private final String expectedContextName = "null"; - private final CompletionKind expectedKind = CompletionKind.FIELD_TYPE; // should be CompletionKind.ARGUMENT_TYPE; + private final CompletionKind expectedKind = CompletionKind.ARGUMENT_TYPE; private final String expectedPrefix = "a"; private final String[] expectedResults = { "aClass", @@ -40,13 +39,13 @@ public class CompletionTest_ArgumentType_Prefix2_Bug50642 extends CompletionPro "AStruct" }; - public CompletionTest_ArgumentType_Prefix2_Bug50642(String name) { + public CompletionTest_ArgumentType_Prefix2(String name) { super(name); } public static Test suite() { - TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix2_Bug50642.class.getName()); - suite.addTest(new CompletionTest_ArgumentType_Prefix2_Bug50642("testCompletionProposals")); + TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix2.class.getName()); + suite.addTest(new CompletionTest_ArgumentType_Prefix2("testCompletionProposals")); return suite; } /* (non-Javadoc)