33 instantiations of AtsTypeRef
Aspire.Hosting.RemoteHost (31)
AtsCapabilityScanner.cs (31)
762var targetTypeRef = capability.TargetType ?? new AtsTypeRef 792var concreteTypeRef = new AtsTypeRef 1100: new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 1102propertyTypeRef = new AtsTypeRef 1127propertyTypeRef = new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 1144var contextTypeRef = new AtsTypeRef 1250var instanceContextTypeRef = new AtsTypeRef 1569? new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback } 1623returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1627returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1635?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 1636: new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1641?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 1669var voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1986private static AtsTypeRef CreateVoidTypeRef() => new AtsTypeRef 2056return new AtsTypeRef { TypeId = primitiveTypeId, ClrType = type, Category = AtsTypeCategory.Primitive }; 2062return new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = type, Category = AtsTypeCategory.Primitive }; 2071return new AtsTypeRef 2094return new AtsTypeRef 2117return new AtsTypeRef 2139return new AtsTypeRef 2159return new AtsTypeRef 2187return new AtsTypeRef 2198return new AtsTypeRef 2218return new AtsTypeRef 2234return new AtsTypeRef 2246return new AtsTypeRef 2256return new AtsTypeRef 2336allInterfaces.Add(new AtsTypeRef 2371baseTypes.Add(new AtsTypeRef 2631return new AtsTypeRef
Aspire.Hosting.RemoteHost.Tests (2)
AtsMarshallerTests.cs (2)
190var typeRef = new AtsTypeRef 730var typeRef = new AtsTypeRef { TypeId = "test/SelfReferencingDto", Category = AtsTypeCategory.Dto };
137 references to AtsTypeRef
Aspire.Hosting.CodeGeneration.Go (8)
AtsGoCodeGenerator.cs (8)
227var returnType = method.ReturnType!; 396private static bool IsListOrDictPropertyGetter(AtsTypeRef? returnType) 408var returnType = capability.ReturnType!; 558foreach (var expandedType in capability.ExpandedTargetTypes) 604foreach (var targetType in targetTypes) 648private string MapTypeRefToGo(AtsTypeRef? typeRef, bool isOptional) 726private static void AddHandleTypeIfNeeded(HashSet<string> handleTypeIds, AtsTypeRef? typeRef) 746private static void AddListOrDictTypeIfNeeded(Dictionary<string, bool> typeIds, AtsTypeRef? typeRef)
Aspire.Hosting.CodeGeneration.Java (7)
AtsJavaCodeGenerator.cs (7)
348private static bool IsListOrDictPropertyGetter(AtsTypeRef? returnType) 360var returnType = capability.ReturnType!; 528foreach (var expandedType in capability.ExpandedTargetTypes) 574foreach (var targetType in targetTypes) 617private string MapTypeRefToJava(AtsTypeRef? typeRef, bool isOptional) 682private static void AddHandleTypeIfNeeded(HashSet<string> handleTypeIds, AtsTypeRef? typeRef) 702private static void AddListOrDictTypeIfNeeded(Dictionary<string, bool> typeIds, AtsTypeRef? typeRef)
Aspire.Hosting.CodeGeneration.Python (9)
AtsPythonCodeGenerator.cs (9)
301private static bool IsListOrDictPropertyGetter(AtsTypeRef? returnType) 313var returnType = capability.ReturnType!; 435foreach (var expandedType in capability.ExpandedTargetTypes) 479foreach (var targetType in targetTypes) 568private string MapTypeRefToPython(AtsTypeRef? typeRef) 600private string MapUnionType(AtsTypeRef typeRef) 637AtsTypeRef? returnType) 652private static void AddHandleTypeIfNeeded(HashSet<string> handleTypeIds, AtsTypeRef? typeRef) 665private static void AddListOrDictTypeIfNeeded(Dictionary<string, bool> typeIds, AtsTypeRef? typeRef)
Aspire.Hosting.CodeGeneration.Rust (13)
AtsRustCodeGenerator.cs (13)
449var returnTypeRef = capability.ReturnType; 496private static bool IsListOrDictPropertyGetter(AtsTypeRef? returnType) 510var returnType = capability.ReturnType!; 636foreach (var expandedType in capability.ExpandedTargetTypes) 682foreach (var targetType in targetTypes) 724private string MapTypeRefToRust(AtsTypeRef? typeRef, bool isOptional) 762private string MapTypeRefToRustForDto(AtsTypeRef? typeRef, bool isOptional) 818private string MapParameterTypeToRust(AtsTypeRef? typeRef, bool isOptional) 850private static bool IsHandleType(AtsTypeRef? typeRef) => 855private static bool IsCollectionOfHandleTypes(AtsTypeRef? typeRef) => 861private static bool IsAspireListOrDictParam(AtsTypeRef? typeRef) => 873private static void AddHandleTypeIfNeeded(HashSet<string> handleTypeIds, AtsTypeRef? typeRef) 893private static void AddListOrDictTypeIfNeeded(HashSet<string> typeIds, AtsTypeRef? typeRef)
Aspire.Hosting.CodeGeneration.TypeScript (22)
AtsTypeScriptCodeGenerator.cs (22)
20public AtsTypeRef? TargetType { get; init; } 128private static bool IsHandleType(AtsTypeRef? typeRef) => 135private string MapTypeRefToTypeScript(AtsTypeRef? typeRef) 208private string MapUnionTypeToTypeScript(AtsTypeRef typeRef) 250private string MapInputTypeToTypeScript(AtsTypeRef? typeRef) 282private static bool IsInterfaceHandleType(AtsTypeRef? typeRef) 291private static bool IsCancellationTokenType(AtsTypeRef? typeRef) => typeRef?.TypeId == AtsConstants.CancellationToken; 293private static string GetRpcArgumentValueExpression(string parameterName, AtsTypeRef? typeRef) 298private static string GetRpcArgumentEntry(string parameterName, AtsTypeRef? typeRef) 1394private string GenerateCallbackTypeSignature(IReadOnlyList<AtsCallbackParameterInfo>? callbackParameters, AtsTypeRef? callbackReturnType) 1938private static bool IsDictionaryType(AtsTypeRef? typeRef) 1946private static bool IsListType(AtsTypeRef? typeRef) 2527var typeRefsByTypeId = new Dictionary<string, AtsTypeRef>(); 2534var targetTypeRef = cap.TargetType; 2560foreach (var expandedType in expandedTypes) 2606var typeRef = typeRefsByTypeId.GetValueOrDefault(typeId); 2639var typeRef = typeRefsByTypeId.GetValueOrDefault(interfaceTypeId); 2713private static Dictionary<string, AtsTypeRef> CollectAllReferencedTypes(IReadOnlyList<AtsCapabilityInfo> capabilities) 2715var typeRefs = new Dictionary<string, AtsTypeRef>(); 2717void CollectFromTypeRef(AtsTypeRef? typeRef) 2735foreach (var unionType in typeRef.UnionTypes) 2845private string? GetPromiseWrapperForReturnType(AtsTypeRef? returnType)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (7)
AtsTypeScriptCodeGeneratorTests.cs (7)
252var testRedisTarget = withOptionalString.ExpandedTargetTypes.FirstOrDefault(t => 436foreach (var expandedType in cap.ExpandedTargetTypes) 500var testRedisExpanded = withConnectionStringDirect.ExpandedTargetTypes 528var testRedisExpanded = withRedisSpecific.ExpandedTargetTypes 554var containerExpanded = withBindMount.ExpandedTargetTypes 650foreach (var expandedType in withConnectionStringDirect.ExpandedTargetTypes) 685var testRedisExpanded = testWithEnvironmentCallback.ExpandedTargetTypes
Aspire.Hosting.RemoteHost (54)
Ats\AtsMarshaller.cs (2)
131public JsonNode? MarshalToJson(object? value, AtsTypeRef typeRef) 193private JsonNode? SerializeArray(object value, AtsTypeRef? elementType)
AtsCapabilityScanner.cs (51)
541private static void CollectEnumClrTypes(AtsTypeRef? typeRef, Dictionary<string, Type> enumTypes) 595private static void ResolveTypeRef(AtsTypeRef? typeRef, HashSet<string> validTypes) 616foreach (var memberType in typeRef.UnionTypes) 691private static string? FindUnknownType(AtsTypeRef? typeRef) 716foreach (var memberType in typeRef.UnionTypes) 762var targetTypeRef = capability.TargetType ?? new AtsTypeRef 779private static Dictionary<string, List<AtsTypeRef>> BuildTypeCompatibilityMap( 782var typeToCompatibleTypes = new Dictionary<string, List<AtsTypeRef>>(); 792var concreteTypeRef = new AtsTypeRef 805foreach (var iface in typeInfo.ImplementedInterfaces) 811foreach (var baseType in typeInfo.BaseTypeHierarchy) 824Dictionary<string, List<AtsTypeRef>> map, 826AtsTypeRef concreteTypeRef) 971var propTypeRef = CreateTypeRef(prop.PropertyType, enumCollector: null, assemblyExportedTypeCache); 1080AtsTypeRef? propertyTypeRef; 1095var keyTypeRef = CreateTypeRef(propType.GetGenericArguments().First(), enumCollector: null, assemblyExportedTypeCache); 1098var valueTypeRef = propertyUnionAttr != null 1144var contextTypeRef = new AtsTypeRef 1250var instanceContextTypeRef = new AtsTypeRef 1365var returnTypeRef = CreateTypeRef(method.ReturnType, enumCollector: null, assemblyExportedTypeCache); 1440AtsTypeRef? extendsTypeRef = null; 1493var returnTypeRef = CreateTypeRef(method.ReturnType, enumCollector: null, assemblyExportedTypeCache); 1529var unionTypeRef = CreateUnionTypeRef(unionAttr, $"parameter '{paramName}'", assemblyExportedTypeCache); 1545var typeRef = CreateTypeRef(paramType, enumCollector: null, assemblyExportedTypeCache); 1557AtsTypeRef? callbackReturnType = null; 1568var finalTypeRef = isCallback 1588private static (IReadOnlyList<AtsCallbackParameterInfo>? Parameters, AtsTypeRef? ReturnType) ExtractCallbackSignature( 1606var paramTypeRef = CreateTypeRef(paramType, enumCollector: null, assemblyExportedTypeCache); 1619AtsTypeRef? returnTypeRef; 1652private static (IReadOnlyList<AtsCallbackParameterInfo>? Parameters, AtsTypeRef? ReturnType) ExtractWellKnownDelegateSignature( 1669var voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1678var paramTypeRef = CreateTypeRef(paramType, enumCollector: null, assemblyExportedTypeCache); 1699var paramTypeRef = CreateTypeRef(paramType, enumCollector: null, assemblyExportedTypeCache); 1711AtsTypeRef returnTypeRef; 1980public static AtsTypeRef? CreateTypeRef(Type? type) => 1986private static AtsTypeRef CreateVoidTypeRef() => new AtsTypeRef 1995private static AtsTypeRef? CreateTypeRef( 2090var keyTypeRef = CreateTypeRef(genericArgs[0], enumCollector, assemblyExportedTypeCache); 2091var valueTypeRef = CreateTypeRef(genericArgs[1], enumCollector, assemblyExportedTypeCache); 2113var keyTypeRef = CreateTypeRef(genericArgs[0], enumCollector, assemblyExportedTypeCache); 2114var valueTypeRef = CreateTypeRef(genericArgs[1], enumCollector, assemblyExportedTypeCache); 2136var elementTypeRef = CreateTypeRef(genericArgs[0], enumCollector, assemblyExportedTypeCache); 2156var elementTypeRef = CreateTypeRef(genericArgs[0], enumCollector, assemblyExportedTypeCache); 2215var elementTypeRef = CreateTypeRef(elementType, enumCollector, assemblyExportedTypeCache); 2328private static List<AtsTypeRef> CollectAllInterfaces(Type type) 2330var allInterfaces = new List<AtsTypeRef>(); 2352private static List<AtsTypeRef> CollectBaseTypeHierarchy(Type type) 2354var baseTypes = new List<AtsTypeRef>(); 2605private static AtsTypeRef CreateUnionTypeRef( 2617var unionTypes = new List<AtsTypeRef>(); 2620var typeRef = CreateTypeRef(memberType, enumCollector: null, assemblyExportedTypeCache);
CodeGeneration\CodeGenerationService.cs (1)
95private static TypeRefResponse MapTypeRef(AtsTypeRef t) => new()
Aspire.Hosting.RemoteHost.Tests (4)
AtsCapabilityScannerTests.cs (2)
140var itemsType = Assert.IsType<AtsTypeRef>(itemsParameter.Type);
AtsMarshallerTests.cs (2)
190var typeRef = new AtsTypeRef 730var typeRef = new AtsTypeRef { TypeId = "test/SelfReferencingDto", Category = AtsTypeCategory.Dto };
Aspire.TypeSystem (13)
AtsCapabilityInfo.cs (13)
37public AtsTypeRef? ElementType { get; init; } 42public AtsTypeRef? KeyType { get; init; } 47public AtsTypeRef? ValueType { get; init; } 75public IReadOnlyList<AtsTypeRef>? UnionTypes { get; init; } 199public required AtsTypeRef ReturnType { get; init; } 210public AtsTypeRef? TargetType { get; init; } 226public IReadOnlyList<AtsTypeRef> ExpandedTargetTypes { get; set; } = []; 265public AtsTypeRef? Type { get; init; } 293public AtsTypeRef? CallbackReturnType { get; init; } 314public required AtsTypeRef Type { get; init; } 341public IReadOnlyList<AtsTypeRef> ImplementedInterfaces { get; init; } = []; 348public IReadOnlyList<AtsTypeRef> BaseTypeHierarchy { get; init; } = []; 413public required AtsTypeRef Type { get; init; }