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:
parent
9ba01d10c4
commit
9838c1b387
3 changed files with 27 additions and 3 deletions
|
@ -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.
|
||||
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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 ); }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue