mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Partial fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=60298
This commit is contained in:
parent
a92b1a4015
commit
6043c77b35
4 changed files with 25 additions and 6 deletions
|
@ -59,7 +59,7 @@ public interface IASTCompletionNode {
|
||||||
public static final CompletionKind PREPROCESSOR_DIRECTIVE = new CompletionKind( 13 );
|
public static final CompletionKind PREPROCESSOR_DIRECTIVE = new CompletionKind( 13 );
|
||||||
|
|
||||||
// any place where a type or variable name is expected to be introduced
|
// any place where a type or variable name is expected to be introduced
|
||||||
public static final CompletionKind USER_SPECIFIED_NAME = new CompletionKind( 14 );
|
public static final CompletionKind NESTED_NAME_REFERENCE = new CompletionKind( 14 );
|
||||||
|
|
||||||
// any place where function parameters are expected
|
// any place where function parameters are expected
|
||||||
public static final CompletionKind FUNCTION_REFERENCE = new CompletionKind( 15 );
|
public static final CompletionKind FUNCTION_REFERENCE = new CompletionKind( 15 );
|
||||||
|
|
|
@ -806,4 +806,10 @@ public class DeclarationWrapper implements IDeclaratorOwner
|
||||||
{
|
{
|
||||||
return extensionParameters;
|
return extensionParameters;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean consumedRawType() {
|
||||||
|
return( getSimpleType() != IASTSimpleTypeSpecifier.Type.UNSPECIFIED );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1669,11 +1669,11 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
if (lookAheadForDeclarator(flags))
|
if (lookAheadForDeclarator(flags))
|
||||||
{
|
{
|
||||||
setTypeName(sdw, typeNameBegin, typeNameEnd);
|
setTypeName(sdw, typeNameBegin, typeNameEnd);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setCompletionValues(sdw.getScope(), kind, key );
|
IASTCompletionNode.CompletionKind ourKind = determineDeclSpecCompletionKind(sdw, kind);
|
||||||
ITokenDuple d = name(sdw.getScope(), kind, key );
|
setCompletionValues(sdw.getScope(), ourKind, key );
|
||||||
|
ITokenDuple d = name(sdw.getScope(), ourKind, key );
|
||||||
sdw.setTypeName(d);
|
sdw.setTypeName(d);
|
||||||
sdw.setSimpleType( IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME );
|
sdw.setSimpleType( IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME );
|
||||||
flags.setEncounteredTypename(true);
|
flags.setEncounteredTypename(true);
|
||||||
|
@ -1728,6 +1728,19 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
* @param sdw
|
||||||
|
* @param kind
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
protected CompletionKind determineDeclSpecCompletionKind(DeclarationWrapper sdw, CompletionKind kind) {
|
||||||
|
if( kind == CompletionKind.ARGUMENT_TYPE ) return kind;
|
||||||
|
if( sdw.getScope() instanceof IASTCompilationUnit || sdw.getScope() instanceof IASTNamespaceDefinition )
|
||||||
|
return sdw.consumedRawType() ? CompletionKind.NESTED_NAME_REFERENCE: kind;
|
||||||
|
return kind;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* @param sdw
|
* @param sdw
|
||||||
* @param typeNameBegin
|
* @param typeNameBegin
|
||||||
* @param typeNameEnd
|
* @param typeNameEnd
|
||||||
|
|
|
@ -885,8 +885,8 @@ public class CompletionEngine implements RelevanceConstants {
|
||||||
kindStr = "NEW_TYPE_REFERENCE"; //$NON-NLS-1$
|
kindStr = "NEW_TYPE_REFERENCE"; //$NON-NLS-1$
|
||||||
else if(kind == IASTCompletionNode.CompletionKind.PREPROCESSOR_DIRECTIVE)
|
else if(kind == IASTCompletionNode.CompletionKind.PREPROCESSOR_DIRECTIVE)
|
||||||
kindStr = "PREPROCESSOR_DIRECTIVE"; //$NON-NLS-1$
|
kindStr = "PREPROCESSOR_DIRECTIVE"; //$NON-NLS-1$
|
||||||
else if(kind == IASTCompletionNode.CompletionKind.USER_SPECIFIED_NAME)
|
else if(kind == IASTCompletionNode.CompletionKind.NESTED_NAME_REFERENCE)
|
||||||
kindStr = "USER_SPECIFIED_NAME"; //$NON-NLS-1$
|
kindStr = "NESTED_NAME_REFERENCE"; //$NON-NLS-1$
|
||||||
else if(kind == IASTCompletionNode.CompletionKind.STRUCT_REFERENCE)
|
else if(kind == IASTCompletionNode.CompletionKind.STRUCT_REFERENCE)
|
||||||
kindStr = "STRUCT_REFERENCE"; //$NON-NLS-1$
|
kindStr = "STRUCT_REFERENCE"; //$NON-NLS-1$
|
||||||
else if(kind == IASTCompletionNode.CompletionKind.UNION_REFERENCE)
|
else if(kind == IASTCompletionNode.CompletionKind.UNION_REFERENCE)
|
||||||
|
|
Loading…
Add table
Reference in a new issue