mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
org.eclipse.cdt.core
Fixed 50642 - Wrong completion kind when declaring an argument type Updated using declarations for more accurate keywords and closure. org.eclipse.cdt.ui.tests 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.
This commit is contained in:
parent
752890b1aa
commit
d46025b64f
9 changed files with 211 additions and 161 deletions
|
@ -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
|
2004-01-29 Hoda Amer
|
||||||
Put CompletionKind.FUNCTION_REFERENCE back.
|
Put CompletionKind.FUNCTION_REFERENCE back.
|
||||||
|
|
||||||
|
|
|
@ -301,13 +301,16 @@ public abstract class Parser implements IParser
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
boolean typeName = false;
|
boolean typeName = false;
|
||||||
|
setCompletionValues(scope, CompletionKind.TYPE_REFERENCE, Key.POST_USING );
|
||||||
|
|
||||||
if (LT(1) == IToken.t_typename)
|
if (LT(1) == IToken.t_typename)
|
||||||
{
|
{
|
||||||
typeName = true;
|
typeName = true;
|
||||||
consume(IToken.t_typename);
|
consume(IToken.t_typename);
|
||||||
|
|
||||||
}
|
}
|
||||||
setCompletionValues(scope, CompletionKind.TYPE_REFERENCE, Key.EMPTY );
|
|
||||||
|
setCompletionValues(scope, CompletionKind.TYPE_REFERENCE, Key.NAMESPACE_ONLY );
|
||||||
TokenDuple name = null;
|
TokenDuple name = null;
|
||||||
if (LT(1) == IToken.tIDENTIFIER || LT(1) == IToken.tCOLONCOLON)
|
if (LT(1) == IToken.tIDENTIFIER || LT(1) == IToken.tCOLONCOLON)
|
||||||
{
|
{
|
||||||
|
@ -337,6 +340,7 @@ public abstract class Parser implements IParser
|
||||||
throw backtrack;
|
throw backtrack;
|
||||||
}
|
}
|
||||||
declaration.acceptElement( requestor );
|
declaration.acceptElement( requestor );
|
||||||
|
setCompletionValues(scope, getCompletionKindForDeclaration(scope, null), Key.DECLARATION );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1206,6 +1210,7 @@ public abstract class Parser implements IParser
|
||||||
throw backtrack;
|
throw backtrack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setCompletionValues(scope,CompletionKind.USER_SPECIFIED_NAME,Key.EMPTY );
|
||||||
if (LT(1) != IToken.tSEMI)
|
if (LT(1) != IToken.tSEMI)
|
||||||
initDeclarator(sdw, SimpleDeclarationStrategy.TRY_FUNCTION );
|
initDeclarator(sdw, SimpleDeclarationStrategy.TRY_FUNCTION );
|
||||||
|
|
||||||
|
@ -2188,11 +2193,11 @@ public abstract class Parser implements IParser
|
||||||
{
|
{
|
||||||
case IToken.tLPAREN :
|
case IToken.tLPAREN :
|
||||||
|
|
||||||
|
boolean failed = false;
|
||||||
// temporary fix for initializer/function declaration ambiguity
|
// 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();
|
IToken newMark = mark();
|
||||||
consume( IToken.tLPAREN );
|
consume( IToken.tLPAREN );
|
||||||
|
@ -2215,138 +2220,141 @@ public abstract class Parser implements IParser
|
||||||
|
|
||||||
backup( newMark );
|
backup( newMark );
|
||||||
}
|
}
|
||||||
if( !failed )
|
}
|
||||||
{
|
if( ( queryLookaheadCapability(2) && !LA(2).looksLikeExpression() && strategy != SimpleDeclarationStrategy.TRY_VARIABLE && !failed) || ! queryLookaheadCapability(3) )
|
||||||
// parameterDeclarationClause
|
{
|
||||||
d.setIsFunction(true);
|
// parameterDeclarationClause
|
||||||
// TODO need to create a temporary scope object here
|
d.setIsFunction(true);
|
||||||
consume(IToken.tLPAREN);
|
// TODO need to create a temporary scope object here
|
||||||
boolean seenParameter = false;
|
consume(IToken.tLPAREN);
|
||||||
parameterDeclarationLoop : for (;;)
|
setCompletionValues( scope, CompletionKind.ARGUMENT_TYPE, Key.DECL_SPECIFIER_SEQUENCE );
|
||||||
{
|
boolean seenParameter = false;
|
||||||
switch (LT(1))
|
parameterDeclarationLoop : for (;;)
|
||||||
{
|
|
||||||
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 (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();
|
switch (LT(1))
|
||||||
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))
|
case IToken.tRPAREN :
|
||||||
{
|
consume();
|
||||||
case IToken.tRPAREN :
|
setCompletionValues( scope, CompletionKind.NO_SUCH_KIND, KeywordSets.Key.FUNCTION_MODIFIER );
|
||||||
consume();
|
break parameterDeclarationLoop;
|
||||||
done = true;
|
case IToken.tELLIPSIS :
|
||||||
break;
|
consume();
|
||||||
case IToken.tCOMMA :
|
d.setIsVarArgs( true );
|
||||||
consume();
|
break;
|
||||||
break;
|
case IToken.tCOMMA :
|
||||||
default :
|
consume();
|
||||||
String image = LA(1).getImage();
|
setCompletionValues( scope, CompletionKind.ARGUMENT_TYPE, Key.DECL_SPECIFIER_SEQUENCE );
|
||||||
try
|
seenParameter = false;
|
||||||
{
|
break;
|
||||||
duple = typeId(scope, false);
|
default :
|
||||||
exceptionSpecIds.add(duple);
|
if (seenParameter)
|
||||||
}
|
throw backtrack;
|
||||||
catch (BacktrackException e)
|
parameterDeclaration(d, scope);
|
||||||
{
|
seenParameter = true;
|
||||||
failParse();
|
|
||||||
log.traceLog(
|
|
||||||
"Unexpected Token ="
|
|
||||||
+ image );
|
|
||||||
consume();
|
|
||||||
// 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 (cvModifier.getType() == IToken.t_const)
|
if (LT(1) == IToken.tCOLON || LT(1) == IToken.t_try )
|
||||||
d.setConst(true);
|
break overallLoop;
|
||||||
if (cvModifier.getType()
|
|
||||||
== IToken.t_volatile)
|
IToken beforeCVModifier = mark();
|
||||||
d.setVolatile(true);
|
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)
|
||||||
|
{
|
||||||
|
switch (LT(1))
|
||||||
|
{
|
||||||
|
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();
|
||||||
|
// eat this token anyway
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
afterCVModifier = mark();
|
|
||||||
// In this case (method) we can't expect K&R parameter declarations,
|
|
||||||
// but we'll check anyway, for errorhandling
|
|
||||||
}
|
}
|
||||||
|
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 (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;
|
break;
|
||||||
case IToken.tLBRACKET :
|
case IToken.tLBRACKET :
|
||||||
|
|
|
@ -33,6 +33,8 @@ public class KeywordSets {
|
||||||
public static final Key STATEMENT = new Key(3);
|
public static final Key STATEMENT = new Key(3);
|
||||||
public static final Key BASE_SPECIFIER = new Key(4);
|
public static final Key BASE_SPECIFIER = new Key(4);
|
||||||
public static final Key POST_USING = new Key( 5 );
|
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
|
* @param enumValue
|
||||||
*/
|
*/
|
||||||
|
@ -56,6 +58,10 @@ public class KeywordSets {
|
||||||
return BASE_SPECIFIER_CPP;
|
return BASE_SPECIFIER_CPP;
|
||||||
if( kind == Key.POST_USING )
|
if( kind == Key.POST_USING )
|
||||||
return POST_USING_CPP;
|
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
|
//TODO finish this
|
||||||
return null;
|
return null;
|
||||||
|
@ -63,6 +69,13 @@ public class KeywordSets {
|
||||||
|
|
||||||
private static final Set EMPTY = new HashSet();
|
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;
|
private static final Set DECL_SPECIFIER_SEQUENCE_C;
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
|
@ -189,4 +202,27 @@ public class KeywordSets {
|
||||||
POST_USING_CPP.add(Keywords.NAMESPACE);
|
POST_USING_CPP.add(Keywords.NAMESPACE);
|
||||||
POST_USING_CPP.add(Keywords.TYPENAME);
|
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 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
2004-01-29 Hoda Amer
|
||||||
Added two more tests, namely Function_Reference and Constructor_Reference.
|
Added two more tests, namely Function_Reference and Constructor_Reference.
|
||||||
Moved tests starts resources all to one directory.
|
Moved tests starts resources all to one directory.
|
||||||
|
|
|
@ -42,10 +42,10 @@ public class AutomatedSuite extends TestSuite {
|
||||||
addTest(CompletionTest_FieldType_NoPrefix2.suite());
|
addTest(CompletionTest_FieldType_NoPrefix2.suite());
|
||||||
addTest(CompletionTest_VariableType_Prefix.suite());
|
addTest(CompletionTest_VariableType_Prefix.suite());
|
||||||
addTest(CompletionTest_VariableType_NoPrefix.suite());
|
addTest(CompletionTest_VariableType_NoPrefix.suite());
|
||||||
addTest(CompletionTest_ArgumentType_NoPrefix_Bug50642.suite());
|
addTest(CompletionTest_ArgumentType_NoPrefix.suite());
|
||||||
addTest(CompletionTest_ArgumentType_NoPrefix2_Bug50642.suite());
|
addTest(CompletionTest_ArgumentType_NoPrefix2.suite());
|
||||||
addTest(CompletionTest_ArgumentType_Prefix_Bug50642.suite());
|
addTest(CompletionTest_ArgumentType_Prefix.suite());
|
||||||
addTest(CompletionTest_ArgumentType_NoPrefix2_Bug50642.suite());
|
addTest(CompletionTest_ArgumentType_NoPrefix2.suite());
|
||||||
addTest(CompletionTest_SingleName_Method_Prefix.suite());
|
addTest(CompletionTest_SingleName_Method_Prefix.suite());
|
||||||
addTest(CompletionTest_SingleName_Method_NoPrefix.suite());
|
addTest(CompletionTest_SingleName_Method_NoPrefix.suite());
|
||||||
addTest(CompletionTest_SingleName_Prefix.suite());
|
addTest(CompletionTest_SingleName_Prefix.suite());
|
||||||
|
|
|
@ -8,14 +8,13 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Rational Software - Initial API and implementation
|
* 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.Test;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
|
import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
|
||||||
import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hamer
|
* @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
|
* 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 fileName = "CompletionTestStart17.cpp";
|
||||||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||||
private final String headerFileName = "CompletionTestStart.h";
|
private final String headerFileName = "CompletionTestStart.h";
|
||||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||||
private final String expectedScopeName = "ASTCompilationUnit";
|
private final String expectedScopeName = "ASTCompilationUnit";
|
||||||
private final String expectedContextName = "null";
|
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 expectedPrefix = "";
|
||||||
private final String[] expectedResults = {
|
private final String[] expectedResults = {
|
||||||
};
|
};
|
||||||
|
|
||||||
public CompletionTest_ArgumentType_NoPrefix_Bug50642(String name) {
|
public CompletionTest_ArgumentType_NoPrefix(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix_Bug50642.class.getName());
|
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix.class.getName());
|
||||||
suite.addTest(new CompletionTest_ArgumentType_NoPrefix_Bug50642("testCompletionProposals"));
|
suite.addTest(new CompletionTest_ArgumentType_NoPrefix("testCompletionProposals"));
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
|
@ -8,13 +8,12 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Rational Software - Initial API and implementation
|
* 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.Test;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
|
import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
|
||||||
import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hamer
|
* @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
|
* 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 fileName = "CompletionTestStart19.cpp";
|
||||||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||||
private final String headerFileName = "CompletionTestStart.h";
|
private final String headerFileName = "CompletionTestStart.h";
|
||||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||||
private final String expectedScopeName = "ASTClassSpecifier";
|
private final String expectedScopeName = "ASTClassSpecifier";
|
||||||
private final String expectedContextName = "null";
|
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 expectedPrefix = "";
|
||||||
private final String[] expectedResults = {
|
private final String[] expectedResults = {
|
||||||
};
|
};
|
||||||
|
|
||||||
public CompletionTest_ArgumentType_NoPrefix2_Bug50642(String name) {
|
public CompletionTest_ArgumentType_NoPrefix2(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix2_Bug50642.class.getName());
|
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix2.class.getName());
|
||||||
suite.addTest(new CompletionTest_ArgumentType_NoPrefix2_Bug50642("testCompletionProposals"));
|
suite.addTest(new CompletionTest_ArgumentType_NoPrefix2("testCompletionProposals"));
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
|
@ -8,13 +8,12 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Rational Software - Initial API and implementation
|
* 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.Test;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
|
import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
|
||||||
import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hamer
|
* @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
|
* 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 fileName = "CompletionTestStart16.cpp";
|
||||||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||||
private final String headerFileName = "CompletionTestStart.h";
|
private final String headerFileName = "CompletionTestStart.h";
|
||||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||||
private final String expectedScopeName = "ASTCompilationUnit";
|
private final String expectedScopeName = "ASTCompilationUnit";
|
||||||
private final String expectedContextName = "null";
|
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 expectedPrefix = "a";
|
||||||
private final String[] expectedResults = {
|
private final String[] expectedResults = {
|
||||||
"aClass",
|
"aClass",
|
||||||
|
@ -40,13 +39,13 @@ public class CompletionTest_ArgumentType_Prefix_Bug50642 extends CompletionProp
|
||||||
"AStruct"
|
"AStruct"
|
||||||
};
|
};
|
||||||
|
|
||||||
public CompletionTest_ArgumentType_Prefix_Bug50642(String name) {
|
public CompletionTest_ArgumentType_Prefix(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix_Bug50642.class.getName());
|
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix.class.getName());
|
||||||
suite.addTest(new CompletionTest_ArgumentType_Prefix_Bug50642("testCompletionProposals"));
|
suite.addTest(new CompletionTest_ArgumentType_Prefix("testCompletionProposals"));
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
|
@ -8,13 +8,12 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Rational Software - Initial API and implementation
|
* 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.Test;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
|
import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
|
||||||
import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hamer
|
* @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
|
* 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 fileName = "CompletionTestStart18.cpp";
|
||||||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||||
private final String headerFileName = "CompletionTestStart.h";
|
private final String headerFileName = "CompletionTestStart.h";
|
||||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||||
private final String expectedScopeName = "ASTClassSpecifier";
|
private final String expectedScopeName = "ASTClassSpecifier";
|
||||||
private final String expectedContextName = "null";
|
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 expectedPrefix = "a";
|
||||||
private final String[] expectedResults = {
|
private final String[] expectedResults = {
|
||||||
"aClass",
|
"aClass",
|
||||||
|
@ -40,13 +39,13 @@ public class CompletionTest_ArgumentType_Prefix2_Bug50642 extends CompletionPro
|
||||||
"AStruct"
|
"AStruct"
|
||||||
};
|
};
|
||||||
|
|
||||||
public CompletionTest_ArgumentType_Prefix2_Bug50642(String name) {
|
public CompletionTest_ArgumentType_Prefix2(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix2_Bug50642.class.getName());
|
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix2.class.getName());
|
||||||
suite.addTest(new CompletionTest_ArgumentType_Prefix2_Bug50642("testCompletionProposals"));
|
suite.addTest(new CompletionTest_ArgumentType_Prefix2("testCompletionProposals"));
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
Loading…
Add table
Reference in a new issue