mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 02:36:01 +02:00
Partial fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=60298
This commit is contained in:
parent
81b654bb3b
commit
e50393060e
2 changed files with 20 additions and 17 deletions
|
@ -694,7 +694,7 @@ public class ExpressionParser implements IExpressionParser, IParserData {
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
nameDuple = name(d.getScope(), CompletionKind.USER_SPECIFIED_NAME, Key.EMPTY );
|
nameDuple = name(d.getScope(), CompletionKind.SINGLE_NAME_REFERENCE, Key.EMPTY );
|
||||||
}
|
}
|
||||||
catch( BacktrackException bt )
|
catch( BacktrackException bt )
|
||||||
{
|
{
|
||||||
|
|
|
@ -866,7 +866,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
|
|
||||||
IASTCompletionNode.CompletionKind kind = getCompletionKindForDeclaration(scope, null);
|
IASTCompletionNode.CompletionKind kind = getCompletionKindForDeclaration(scope, null);
|
||||||
|
|
||||||
setCompletionValues(scope,CompletionKind.USER_SPECIFIED_NAME, Key.EMPTY );
|
setCompletionValues(scope,CompletionKind.NAMESPACE_REFERENCE, Key.EMPTY );
|
||||||
IToken identifier = null;
|
IToken identifier = null;
|
||||||
// optional name
|
// optional name
|
||||||
if (LT(1) == IToken.tIDENTIFIER)
|
if (LT(1) == IToken.tIDENTIFIER)
|
||||||
|
@ -1271,7 +1271,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
throw backtrack;
|
throw backtrack;
|
||||||
}
|
}
|
||||||
|
|
||||||
setCompletionValues(scope,CompletionKind.USER_SPECIFIED_NAME,Key.EMPTY );
|
setCompletionValues(scope,CompletionKind.SINGLE_NAME_REFERENCE,Key.EMPTY );
|
||||||
if (LT(1) != IToken.tSEMI)
|
if (LT(1) != IToken.tSEMI)
|
||||||
initDeclarator(sdw, SimpleDeclarationStrategy.TRY_FUNCTION, CompletionKind.VARIABLE_TYPE );
|
initDeclarator(sdw, SimpleDeclarationStrategy.TRY_FUNCTION, CompletionKind.VARIABLE_TYPE );
|
||||||
|
|
||||||
|
@ -1643,30 +1643,22 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
// TODO - Kludgy way to handle constructors/destructors
|
// TODO - Kludgy way to handle constructors/destructors
|
||||||
if (flags.haveEncounteredRawType())
|
if (flags.haveEncounteredRawType())
|
||||||
{
|
{
|
||||||
if (typeNameBegin != null)
|
setTypeName(sdw, typeNameBegin, typeNameEnd);
|
||||||
sdw.setTypeName(
|
|
||||||
new TokenDuple(typeNameBegin, typeNameEnd));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (parm && flags.haveEncounteredTypename())
|
if (parm && flags.haveEncounteredTypename())
|
||||||
{
|
{
|
||||||
if (typeNameBegin != null)
|
setTypeName(sdw, typeNameBegin, typeNameEnd);
|
||||||
sdw.setTypeName(
|
|
||||||
new TokenDuple(typeNameBegin, typeNameEnd));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (lookAheadForConstructorOrConversion(flags, sdw, kind))
|
if (lookAheadForConstructorOrConversion(flags, sdw, kind))
|
||||||
{
|
{
|
||||||
if (typeNameBegin != null)
|
setTypeName(sdw, typeNameBegin, typeNameEnd);
|
||||||
sdw.setTypeName(
|
|
||||||
new TokenDuple(typeNameBegin, typeNameEnd));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (lookAheadForDeclarator(flags))
|
if (lookAheadForDeclarator(flags))
|
||||||
{
|
{
|
||||||
if (typeNameBegin != null)
|
setTypeName(sdw, typeNameBegin, typeNameEnd);
|
||||||
sdw.setTypeName(
|
|
||||||
new TokenDuple(typeNameBegin, typeNameEnd));
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1722,11 +1714,22 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
break declSpecifiers;
|
break declSpecifiers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (typeNameBegin != null)
|
setTypeName(sdw, typeNameBegin, typeNameEnd);
|
||||||
sdw.setTypeName(new TokenDuple(typeNameBegin, typeNameEnd));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
* @param sdw
|
||||||
|
* @param typeNameBegin
|
||||||
|
* @param typeNameEnd
|
||||||
|
*/
|
||||||
|
private void setTypeName(DeclarationWrapper sdw, IToken typeNameBegin, IToken typeNameEnd) {
|
||||||
|
if (typeNameBegin != null)
|
||||||
|
sdw.setTypeName(
|
||||||
|
new TokenDuple(typeNameBegin, typeNameEnd));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* Parse an elaborated type specifier.
|
* Parse an elaborated type specifier.
|
||||||
*
|
*
|
||||||
* @param decl Declaration which owns the elaborated type
|
* @param decl Declaration which owns the elaborated type
|
||||||
|
|
Loading…
Add table
Reference in a new issue