1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

bug 52948 - Content Assist -typedef'd types do not appear in the completion list

This commit is contained in:
Andrew Niefer 2004-03-09 19:07:22 +00:00
parent 9ba01d10c4
commit 9838c1b387
3 changed files with 27 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2004-03-09 Andrew Niefer
bug 52948
modified CompleteParseASTFactory.createTypedef() to set the typeSymbol of the typedef symbol
modified TypeFilter to handle LookupKind.TYPES and LookupKind.TYPEDEFS
2004-03-09 John Camelon
Put back the work to reconcile relative paths w/IResource readers which was lost upon merge.

View file

@ -2480,7 +2480,12 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
IContainerSymbol containerSymbol = scopeToSymbol(scope);
ISymbol newSymbol = pst.newSymbol( name, TypeInfo.t_type);
newSymbol.getTypeInfo().setBit( true,TypeInfo.isTypedef );
ISymbol typeSymbol = cloneSimpleTypeSymbol( "", mapping, new ArrayList() );
setPointerOperators( typeSymbol, mapping.getPointerOperators(), mapping.getArrayModifiers() );
newSymbol.setTypeSymbol( typeSymbol );
List references = new ArrayList();
if( mapping.getTypeSpecifier() instanceof ASTSimpleTypeSpecifier )
{

View file

@ -74,6 +74,15 @@ public class TypeFilter {
return false;
}
}
else if ( typeInfo.isType( TypeInfo.t_type ) && typeInfo.checkBit( TypeInfo.isTypedef ) ){
if( acceptedKinds.contains( LookupKind.TYPEDEFS ) ||
acceptedKinds.contains( LookupKind.TYPES ) )
{
return true;
} else {
return false;
}
}
else if ( typeInfo.isType( TypeInfo.t_type ) || typeInfo.isType( TypeInfo.t__Bool, TypeInfo.t_void ) )
{
if( ( acceptedKinds.contains( LookupKind.VARIABLES ) && !symbolIsMember && !symbolIsLocal ) ||
@ -99,14 +108,19 @@ public class TypeFilter {
else if ( kind == LookupKind.STRUCTURES ) { acceptedTypes.add( TypeInfo.t_class );
acceptedTypes.add( TypeInfo.t_struct );
acceptedTypes.add( TypeInfo.t_union ); }
else if ( kind == LookupKind.STRUCTS ) { acceptedTypes.add( TypeInfo.t_struct ); }
else if ( kind == LookupKind.STRUCTS ) { acceptedTypes.add( TypeInfo.t_struct ); }
else if ( kind == LookupKind.UNIONS ) { acceptedTypes.add( TypeInfo.t_union ); }
else if ( kind == LookupKind.CLASSES ) { acceptedTypes.add( TypeInfo.t_class ); }
else if ( kind == LookupKind.CONSTRUCTORS ){ acceptedTypes.add( TypeInfo.t_constructor ); }
else if ( kind == LookupKind.NAMESPACES ) { acceptedTypes.add( TypeInfo.t_namespace ); }
else if ( kind == LookupKind.ENUMERATIONS ){ acceptedTypes.add( TypeInfo.t_enumeration ); }
else if ( kind == LookupKind.ENUMERATORS ) { acceptedTypes.add( TypeInfo.t_enumerator ); }
else if ( kind == LookupKind.TYPEDEFS ) { acceptedTypes.add( TypeInfo.t_type ); }
// else if ( kind == LookupKind.TYPEDEFS ) { acceptedTypes.add( TypeInfo.t_type ); }
else if ( kind == LookupKind.TYPES ) { acceptedTypes.add( TypeInfo.t_class );
acceptedTypes.add( TypeInfo.t_struct );
acceptedTypes.add( TypeInfo.t_union );
acceptedTypes.add( TypeInfo.t_enumeration ); }
}