Search in sources :

Example 1 with TypeDefs

use of org.eclipse.n4js.ts.types.TypeDefs in project n4js by eclipse.

the class BuiltInTypeScope method buildMap.

@Override
protected void buildMap(Resource resource, Map<QualifiedName, IEObjectDescription> elements) {
    TypeDefs typeDefinitions = (TypeDefs) resource.getContents().get(0);
    for (Type type : typeDefinitions.getTypes()) {
        if (!(type instanceof VirtualBaseType)) {
            IEObjectDescription description = EObjectDescription.create(type.getName(), type);
            elements.put(description.getName(), description);
        }
    }
}
Also used : VirtualBaseType(org.eclipse.n4js.ts.types.VirtualBaseType) AnyType(org.eclipse.n4js.ts.types.AnyType) Type(org.eclipse.n4js.ts.types.Type) PrimitiveType(org.eclipse.n4js.ts.types.PrimitiveType) VoidType(org.eclipse.n4js.ts.types.VoidType) NullType(org.eclipse.n4js.ts.types.NullType) UndefinedType(org.eclipse.n4js.ts.types.UndefinedType) VirtualBaseType(org.eclipse.n4js.ts.types.VirtualBaseType) TypeDefs(org.eclipse.n4js.ts.types.TypeDefs) IEObjectDescription(org.eclipse.xtext.resource.IEObjectDescription)

Example 2 with TypeDefs

use of org.eclipse.n4js.ts.types.TypeDefs in project n4js by eclipse.

the class VirtualBaseTypeScope method buildMap.

@Override
protected void buildMap(Resource resource, Map<QualifiedName, IEObjectDescription> elements) {
    TypeDefs typeDefinitions = (TypeDefs) resource.getContents().get(0);
    for (Type type : typeDefinitions.getTypes()) {
        if (type instanceof VirtualBaseType) {
            // only virtualBase children.
            IEObjectDescription description = EObjectDescription.create(type.getName(), type);
            elements.put(description.getName(), description);
        }
    }
}
Also used : Type(org.eclipse.n4js.ts.types.Type) VirtualBaseType(org.eclipse.n4js.ts.types.VirtualBaseType) VirtualBaseType(org.eclipse.n4js.ts.types.VirtualBaseType) TypeDefs(org.eclipse.n4js.ts.types.TypeDefs) IEObjectDescription(org.eclipse.xtext.resource.IEObjectDescription)

Aggregations

Type (org.eclipse.n4js.ts.types.Type)2 TypeDefs (org.eclipse.n4js.ts.types.TypeDefs)2 VirtualBaseType (org.eclipse.n4js.ts.types.VirtualBaseType)2 IEObjectDescription (org.eclipse.xtext.resource.IEObjectDescription)2 AnyType (org.eclipse.n4js.ts.types.AnyType)1 NullType (org.eclipse.n4js.ts.types.NullType)1 PrimitiveType (org.eclipse.n4js.ts.types.PrimitiveType)1 UndefinedType (org.eclipse.n4js.ts.types.UndefinedType)1 VoidType (org.eclipse.n4js.ts.types.VoidType)1