mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 11:25:35 +02:00
org.eclipse.cdt.core: Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=58500. Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=58178 <BR>
org.eclipse.cdt.core.tests: Added CompletionTest::testBug58178().
This commit is contained in:
parent
ca7982b5b8
commit
c73b30f8ce
5 changed files with 25 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
2004-04-14 John Camelon
|
||||||
|
Added CompletionTest::testBug58178().
|
||||||
|
|
||||||
2004-04-14 Andrew Niefer
|
2004-04-14 Andrew Niefer
|
||||||
updated FullParseCallback with acceptFriendDeclaration
|
updated FullParseCallback with acceptFriendDeclaration
|
||||||
added parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.testBug45235()
|
added parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.testBug45235()
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class CompletionParseTest extends CompleteParseBaseTest {
|
||||||
callback,
|
callback,
|
||||||
ParserMode.COMPLETION_PARSE,
|
ParserMode.COMPLETION_PARSE,
|
||||||
ParserLanguage.CPP,
|
ParserLanguage.CPP,
|
||||||
ParserUtil.getParserLogService());
|
null);
|
||||||
|
|
||||||
return parser.parse( offset );
|
return parser.parse( offset );
|
||||||
|
|
||||||
|
@ -829,4 +829,17 @@ public class CompletionParseTest extends CompleteParseBaseTest {
|
||||||
assertFalse( i.hasNext() );
|
assertFalse( i.hasNext() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testBug58178() throws Exception
|
||||||
|
{
|
||||||
|
Writer writer = new StringWriter();
|
||||||
|
writer.write( "#define GL_T 0x2001\n");
|
||||||
|
writer.write( "#define GL_TRUE 0x1\n");
|
||||||
|
writer.write( "typedef unsigned char GLboolean;\n");
|
||||||
|
writer.write( "static GLboolean should_rotate = GL_T");
|
||||||
|
String code = writer.toString();
|
||||||
|
final String where = "= GL_T";
|
||||||
|
IASTCompletionNode node = parse( code, code.indexOf( where ) + where.length() );
|
||||||
|
assertEquals( node.getCompletionPrefix(), "GL_T");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2004-04-14 John Camelon
|
||||||
|
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=58500
|
||||||
|
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=58178
|
||||||
|
|
||||||
2004-04-14 Andrew Niefer
|
2004-04-14 Andrew Niefer
|
||||||
friends in the AST (bugs 45235 & 53759 )
|
friends in the AST (bugs 45235 & 53759 )
|
||||||
- added acceptFriendDeclaration to ISourceElementRequestor
|
- added acceptFriendDeclaration to ISourceElementRequestor
|
||||||
|
|
|
@ -961,6 +961,8 @@ public class ExpressionParser implements IExpressionParser {
|
||||||
buffer.append( "Parser: Unexpected exception in "); //$NON-NLS-1$
|
buffer.append( "Parser: Unexpected exception in "); //$NON-NLS-1$
|
||||||
buffer.append( methodName );
|
buffer.append( methodName );
|
||||||
buffer.append( ":"); //$NON-NLS-1$
|
buffer.append( ":"); //$NON-NLS-1$
|
||||||
|
buffer.append( e.getClass().getName() );
|
||||||
|
buffer.append( "::"); //$NON-NLS-1$
|
||||||
buffer.append( e.getMessage() );
|
buffer.append( e.getMessage() );
|
||||||
buffer.append( ". w/"); //$NON-NLS-1$
|
buffer.append( ". w/"); //$NON-NLS-1$
|
||||||
buffer.append( scanner.toString() );
|
buffer.append( scanner.toString() );
|
||||||
|
@ -1300,7 +1302,7 @@ public class ExpressionParser implements IExpressionParser {
|
||||||
// If this isn't a type name, then we shouldn't be here
|
// If this isn't a type name, then we shouldn't be here
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
typeId = typeId(scope, false, CompletionKind.TYPE_REFERENCE);
|
typeId = typeId(scope, false, ((kind == CompletionKind.SINGLE_NAME_REFERENCE )? kind : CompletionKind.TYPE_REFERENCE));
|
||||||
consume(IToken.tRPAREN);
|
consume(IToken.tRPAREN);
|
||||||
if( templateIdScopes != null ){ templateIdScopes.pop(); popped = true;}
|
if( templateIdScopes != null ){ templateIdScopes.pop(); popped = true;}
|
||||||
IASTExpression castExpression = castExpression(scope,kind);
|
IASTExpression castExpression = castExpression(scope,kind);
|
||||||
|
|
|
@ -1544,7 +1544,7 @@ public class Scanner implements IScanner {
|
||||||
|
|
||||||
IMacroDescriptor mapping = getDefinition(ident);
|
IMacroDescriptor mapping = getDefinition(ident);
|
||||||
|
|
||||||
if (mapping != null)
|
if (mapping != null && !isLimitReached())
|
||||||
if( scannerData.getContextStack().shouldExpandDefinition( ident ) ) {
|
if( scannerData.getContextStack().shouldExpandDefinition( ident ) ) {
|
||||||
expandDefinition(ident, mapping, baseOffset);
|
expandDefinition(ident, mapping, baseOffset);
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue