45 writes to Type
Aspire.Hosting.CodeGeneration.Go (1)
AtsGoCodeGenerator.cs (1)
1545Type = property.Type,
Aspire.Hosting.CodeGeneration.Java.Tests (6)
AtsJavaCodeGeneratorTests.cs (6)
2731Type = new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback }, 2765Type = new AtsTypeRef { TypeId = AtsConstants.CancellationToken, Category = AtsTypeCategory.Dto } 2799Type = resourceType, 2805Type = new AtsTypeRef 2998Type = new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback }, 3316Type = new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback },
Aspire.Hosting.CodeGeneration.Python (1)
AtsPythonCodeGenerator.cs (1)
386Type = p.Type,
Aspire.Hosting.CodeGeneration.Python.Tests (17)
AtsPythonCodeGeneratorTests.cs (17)
516Type = resourceType 521Type = new AtsTypeRef 572Type = resourceType 577Type = new AtsTypeRef 648Type = resourceType 732Type = unionType, 738Type = unionType, 746Type = new AtsTypeRef 833new AtsParameterInfo { Name = "builder", Type = projectType }, 834new AtsParameterInfo { Name = "target", Type = stringType }, 835new AtsParameterInfo { Name = "name", Type = stringType }, 836new AtsParameterInfo { Name = "env", Type = stringType }, 837new AtsParameterInfo { Name = "isReadOnly", Type = boolType, IsOptional = true } 855new AtsParameterInfo { Name = "builder", Type = containerType }, 856new AtsParameterInfo { Name = "target", Type = stringType }, 857new AtsParameterInfo { Name = "name", Type = stringType, IsOptional = true }, 858new AtsParameterInfo { Name = "isReadOnly", Type = boolType, IsOptional = true }
Aspire.Hosting.CodeGeneration.TypeScript (1)
AtsTypeScriptCodeGenerator.cs (1)
1526Type = callbackProperty.Type,
Aspire.Hosting.CodeGeneration.TypeScript.Tests (8)
AtsTypeScriptCodeGeneratorTests.cs (8)
799Type = nullableNumberArrayType 1129Type = CreateResourceTypeRef<TestMarkerResource>() 2307Type = CreateResourceTypeRef<TestPromiseNameCollisionResource>() 2312Type = CreateResourceTypeRef<TestPromiseNameCollisionResourcePromise>() 2608Parameters = [new AtsParameterInfo { Name = "value", Type = stringType }], 2995Type = new AtsTypeRef 3044Type = new AtsTypeRef 3053Type = new AtsTypeRef
Aspire.Hosting.RemoteHost (7)
AtsCapabilityScanner.cs (6)
1692Type = contextTypeRef, 1734Type = contextTypeRef, 1743Type = setterTypeRef, 1856Type = instanceContextTypeRef, 2113Type = unionTypeRef, 2156Type = finalTypeRef,
AtsContextFilter.cs (1)
382Type = pair.Value
Aspire.Hosting.RemoteHost.Tests (4)
AtsContextFilterTests.cs (4)
189Type = new AtsTypeRef 505Type = new AtsTypeRef 515Type = new AtsTypeRef 525Type = new AtsTypeRef
129 references to Type
Aspire.Hosting.CodeGeneration.Go (15)
AtsGoCodeGenerator.cs (14)
172CollectHandleTypeIds(handleTypeIds, parameter.Type); 1101sb.Append(MapDtoType(directOptionsParam.Type!.TypeId)); 1121return MapTypeRefToGo(p.Type, p.IsOptional); 1398if (p.Type?.Category != AtsTypeCategory.Handle) { continue; } 1444var type = MapTypeRefToGo(p.Type, isOptional: false); 1448if (IsNilableGoType(type) && (p.Type is null || !ShouldApplyNullableType(p.Type))) 1466var dtoType = MapDtoType(directOptionsParam.Type!.TypeId); 1719var fieldType = MapTypeRefToGo(p.Type, isOptional: true); 1750return MapTypeRefToGo(p.Type, isOptional: true); 1837if (p.Type?.Category == AtsTypeCategory.Union) 1861var allowed = GetUnionAllowedTypes(p.Type!); 1878var allowed = GetUnionAllowedTypes(p.Type!); 2212IsCancellationTokenTypeId(parameter.Type?.TypeId);
src\Shared\CodeGeneration\AtsOptionsFlattening.cs (1)
54if (candidate.Type?.Category != AtsTypeCategory.Dto)
Aspire.Hosting.CodeGeneration.Go.Tests (1)
AtsGoCodeGeneratorTests.cs (1)
164Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.TypeId == "string");
Aspire.Hosting.CodeGeneration.Java (15)
AtsJavaCodeGenerator.cs (15)
998if (!string.Equals(left.Type?.TypeId, right.Type?.TypeId, StringComparison.Ordinal)) 1123if (parameter.IsCallback || parameter.Type?.Category != AtsTypeCategory.Handle) 1128var wrapperType = MapInputTypeToJava(parameter.Type, parameter.IsOptional || parameter.IsNullable); 1377var unionParameters = parameters.Where(p => IsUnionType(p.Type)).ToList(); 1397var unionTypes = unionParameter.Type?.UnionTypes; 1455.Select(up => up.Type?.UnionTypes? 1570return IsUnionType(parameter.Type) ? "(AspireUnion) null" : "null"; 1579var unionParameters = requiredParameters.Where(p => IsUnionType(p.Type)).ToList(); 1586var unionTypes = unionParameter.Type?.UnionTypes; 2412AddHandleTypeIfNeeded(handleTypeIds, parameter.Type); 2528AddListOrDictTypeIfNeeded(typeIds, parameter.Type); 2624parameter.Type, 2625parameter.IsOptional || parameter.IsNullable || parameter.Type?.IsNullable == true); 2663IsCancellationTokenTypeId(parameter.Type?.TypeId);
Aspire.Hosting.CodeGeneration.Java.Tests (1)
AtsJavaCodeGeneratorTests.cs (1)
132Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.TypeId == "string");
Aspire.Hosting.CodeGeneration.Python (14)
AtsPythonCodeGenerator.cs (14)
275if (param.Type?.TypeId == AtsConstants.CancellationToken) 288if (param.Type?.TypeId == AtsConstants.CancellationToken) 386Type = p.Type, 454filtered = filtered.Where(p => p.Type?.TypeId != AtsConstants.CancellationToken); 466if (param.Type?.TypeId == AtsConstants.CancellationToken) 502(param.IsNullable || AllowsNoneAtTopLevel(param.Type)); 511return AllowsNoneAtTopLevel(param.Type) ? type : $"{type} | None"; 661if (param.Type?.TypeId == AtsConstants.CancellationToken) 666var baseType = MapTypeRefToPython(param.Type); 810if (IsHandleType(param.Type) && !dtoTypeIds.Contains(param.Type!.TypeId)) 812typeIds.Add(param.Type!.TypeId); 1314var valueType = MapTypeRefToPython(valueParam.Type); 2213CollectFromTypeRef(param.Type);
Aspire.Hosting.CodeGeneration.Python.Tests (1)
AtsPythonCodeGeneratorTests.cs (1)
101Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.TypeId == "string");
Aspire.Hosting.CodeGeneration.Rust (9)
AtsRustCodeGenerator.cs (9)
489else if (IsHandleType(parameter.Type)) 492var handleTypeName = MapTypeRefToRust(parameter.Type, false); 498paramType = MapParameterTypeToRust(parameter.Type, parameter.IsOptional); 535if (IsHandleType(parameter.Type)) 551if (IsAspireListOrDictParam(parameter.Type)) 567if (IsCollectionOfHandleTypes(parameter.Type)) 795AddHandleTypeIfNeeded(handleTypeIds, parameter.Type); 884AddListOrDictTypeIfNeeded(typeIds, parameter.Type); 1081IsCancellationTokenTypeId(parameter.Type?.TypeId);
Aspire.Hosting.CodeGeneration.Rust.Tests (1)
AtsRustCodeGeneratorTests.cs (1)
160Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.TypeId == "string");
Aspire.Hosting.CodeGeneration.TypeScript (32)
AtsTypeScriptCodeGenerator.cs (24)
344return GetRpcArgumentValueExpression(localParameterName, param.Type); 362if (TryGetDtoCallbackMarshallingProperties(param.Type, out _)) 796var valueType = _projector.MapInputTypeToTypeScript(valueParam.Type); 1139WriteLine($" {(_projector.IsWidenedHandleType(param.Type) ? "let" : "const")} {localParameterName} = {publicOptionsParamName}?.{param.Name};"); 1175WriteLine($" {(_projector.IsWidenedHandleType(param.Type) ? "let" : "const")} {localParameterName} = {publicOptionsParamName}?.{param.Name};"); 1263WriteLine($" {(_projector.IsWidenedHandleType(param.Type) ? "let" : "const")} {localParameterName} = {publicOptionsParamName}?.{param.Name};"); 1312if (_projector.IsWidenedHandleType(param.Type)) 1427if (!TryGetDtoCallbackMarshallingProperties(param.Type, out var marshallingProperties)) 1432if (param.Type is not { TypeId: var dtoTypeId }) 1721if (!param.IsCallback && _projector.IsWidenedHandleType(param.Type)) 1757if (!param.IsCallback && _projector.IsWidenedHandleType(param.Type)) 2265var valueType = _projector.MapInputTypeToTypeScript(valueParam.Type); 2267GeneratePromiseResolutionForParam("value", valueParam.Type, " "); 2270WriteLine($" {{ context: this._handle, {GetRpcArgumentEntry("value", valueParam.Type)} }}"); 2429var valueType = _projector.MapInputTypeToTypeScript(valueParam.Type); 2431GeneratePromiseResolutionForParam("value", valueParam.Type, " "); 2434WriteLine($" {{ context: this._handle, {GetRpcArgumentEntry("value", valueParam.Type)} }}"); 2633WriteLine($" {(_projector.IsWidenedHandleType(param.Type) ? "let" : "const")} {localParameterName} = {publicOptionsParamName}?.{param.Name};"); 2660WriteLine($" {(_projector.IsWidenedHandleType(param.Type) ? "let" : "const")} {localParameterName} = {publicOptionsParamName}?.{param.Name};"); 2746WriteLine($" {(_projector.IsWidenedHandleType(param.Type) ? "let" : "const")} {localParameterName} = {publicOptionsParamName}?.{param.Name};"); 2773WriteLine($" {(_projector.IsWidenedHandleType(param.Type) ? "let" : "const")} {localParameterName} = {publicOptionsParamName}?.{param.Name};"); 2906WriteLine($" {(_projector.IsWidenedHandleType(param.Type) ? "let" : "const")} {localParameterName} = {publicOptionsParamName}?.{param.Name};"); 2964WriteLine($" {(_projector.IsWidenedHandleType(param.Type) ? "let" : "const")} {localParameterName} = {publicOptionsParamName}?.{param.Name};"); 2984WriteLine($" {(_projector.IsWidenedHandleType(param.Type) ? "let" : "const")} {localParameterName} = {publicOptionsParamName}?.{param.Name};");
src\Shared\CodeGeneration\AtsOptionsFlattening.cs (1)
54if (candidate.Type?.Category != AtsTypeCategory.Dto)
TypeScriptApiProjector.cs (7)
1207accessors.Add($"set: (value: {MapInputTypeToTypeScript(valueParam.Type)}) => Promise<void>"); 1946return MapInputTypeToTypeScript(param.Type); 2129p => IsCancellationTokenType(p.Type), 2146return optionalParams.FirstOrDefault(p => IsCancellationTokenType(p.Type)); 2323var aTypeId = a.Type?.TypeId; 2324var bTypeId = b.Type?.TypeId; 2964CollectFromTypeRef(param.Type);
Aspire.Hosting.CodeGeneration.TypeScript.Tests (16)
AtsTypeScriptCodeGeneratorTests.cs (16)
163Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.TypeId == "string"); 546Assert.Contains(withBrowserLogs.Parameters, p => p.Name == "browser" && p.Type?.TypeId == "string" && p.IsOptional); 547Assert.Contains(withBrowserLogs.Parameters, p => p.Name == "profile" && p.Type?.TypeId == "string" && p.IsOptional); 748Assert.NotNull(dependencyParam.Type); 749Assert.Equal(AtsTypeCategory.Handle, dependencyParam.Type.Category); 750Assert.True(dependencyParam.Type.IsInterface, "IResourceWithConnectionString is an interface"); 1751Assert.Equal(GetAtsTypeId(parameterType), parameter.Type?.TypeId); 1890Assert.NotNull(valueParam.Type); 1891Assert.Equal("any", valueParam.Type.TypeId); 2038Assert.NotNull(ctParam.Type); 2039Assert.Equal(AtsConstants.CancellationToken, ctParam.Type.TypeId); 2040Assert.Equal(AtsTypeCategory.Primitive, ctParam.Type.Category); 2093Assert.Equal(AtsConstants.TimeSpan, timeoutParam.Type?.TypeId); 2097Assert.Equal(AtsConstants.CancellationToken, ctParam.Type?.TypeId); 2212Assert.NotNull(param.Type); 2213Assert.NotEqual(AtsTypeCategory.Unknown, param.Type.Category);
Aspire.Hosting.RemoteHost (8)
Ats\CapabilityDispatcher.cs (1)
913if (parameter?.Type?.UnionTypes is not { Count: > 0 } unionTypes)
AtsCapabilityScanner.cs (3)
541CollectEnumClrTypes(param.Type, enumTypes); 643ResolveTypeRef(param.Type, validTypes); 746var result = FindUnknownType(param.Type);
AtsContextFilter.cs (2)
259CollectReferencedType(parameter.Type, handleTypesById, dtoTypesById, enumTypesById, includedHandleTypeIds, includedDtoTypeIds, includedEnumTypeIds); 365CollectHandleTypes(parameter.Type);
CodeGeneration\CodeGenerationService.cs (2)
124Type = p.Type != null ? MapTypeRef(p.Type) : null,
Aspire.Hosting.RemoteHost.Tests (16)
AtsCapabilityScannerTests.cs (15)
158var itemsType = Assert.IsType<AtsTypeRef>(itemsParameter.Type); 191Assert.Equal(AtsTypeCategory.Union, parameter.Type?.Category); 192Assert.Contains(parameter.Type!.UnionTypes!, type => type.ClrType == typeof(TestUnionEnum)); 193Assert.Contains(parameter.Type.UnionTypes!, type => type.TypeId == AtsConstants.String); 323Assert.Equal(AtsTypeCategory.Union, resourceParameter.Type?.Category); 324Assert.Contains(resourceParameter.Type!.UnionTypes!, type => type.TypeId == "string"); 325Assert.Contains(resourceParameter.Type.UnionTypes!, type => type.TypeId == "Aspire.Hosting/Aspire.Hosting.ApplicationModel.IResource"); 329Assert.Equal(AtsTypeCategory.Dict, argumentsParameter.Type?.Category); 330Assert.True(argumentsParameter.Type?.IsReadOnly); 390Assert.NotNull(optionsParameter.Type); 391Assert.Equal(AtsTypeCategory.Dto, optionsParameter.Type.Category); 392Assert.Equal(AtsTypeMapping.DeriveTypeId(typeof(HttpCommandExportOptions)), optionsParameter.Type.TypeId); 572Assert.NotNull(parameter.Type); 573Assert.Equal(AtsTypeCategory.Handle, parameter.Type.Category); 574Assert.Equal(AtsTypeMapping.DeriveTypeId(typeof(AssemblyLevelExportedTestType)), parameter.Type.TypeId);
AtsContextFilterTests.cs (1)
230Assert.Equal("Aspire.Hosting/Aspire.Hosting.DistributedApplication", supportParameter.Type?.TypeId);