5 implementations of TupleElements
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
23public ImmutableArray<IFieldSymbol> TupleElements { get; protected set; }
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\NamedTypeSymbol.cs (1)
159ImmutableArray<IFieldSymbol> INamedTypeSymbol.TupleElements
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
86public ImmutableArray<IFieldSymbol> TupleElements => _symbol.TupleElements;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\NamedTypeSymbol.vb (1)
1475Private ReadOnly Property INamedTypeSymbol_TupleElements As ImmutableArray(Of IFieldSymbol) Implements INamedTypeSymbol.TupleElements
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
23public ImmutableArray<IFieldSymbol> TupleElements { get; protected set; }
97 references to TupleElements
Microsoft.CodeAnalysis.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (2)
29foreach (var element in symbol.TupleElements) 43foreach (var element in symbol.TupleElements)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
422var xElements = x.TupleElements; 423var yElements = y.TupleElements;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
165return Hash.Combine(currentHash, Hash.CombineValues(x.TupleElements));
Microsoft.CodeAnalysis.CSharp (2)
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
534return tupleSymbol.TupleElements.Any(static e => !e.IsDefaultTupleElement()); 547ImmutableArray<IFieldSymbol> elements = symbol.TupleElements;
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (3)
168if (type is not INamedTypeSymbol { IsTupleType: true, TupleElements.Length: >= 2 } tupleTypeOpt) 173foreach (var element in tupleType.TupleElements) 212foreach (var element in tupleType.TupleElements)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (2)
45if (tupleType.TupleElements.Length != tuple.Arguments.Count) 53var tupleElementType = tupleType.TupleElements[i].Type;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (1)
61if (targetType is not INamedTypeSymbol { IsTupleType: true, TupleElements: var tupleElements })
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
162[.. tupleType.TupleElements.Select(
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
168var elements = ((INamedTypeSymbol)typeSymbol).TupleElements;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
231if (symbol.IsTupleType && symbol.TupleElements.Length >= 2) 254foreach (var element in symbol.TupleElements)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (21)
CodeGen\CodeGenTupleTest.cs (21)
3645foreach (var item in type.TupleElements) 3693Assert.Equal("a", yType.TupleElements[0].Name); 3694Assert.True(yType.TupleElements[0].IsExplicitlyNamedTupleElement); 3695Assert.False(yType.TupleElements[0].CorrespondingTupleField.IsExplicitlyNamedTupleElement); 3697Assert.Equal("Item2", yType.TupleElements[1].Name); 3698Assert.False(yType.TupleElements[1].IsExplicitlyNamedTupleElement); 3699Assert.Same(yType.TupleElements[1], yType.TupleElements[1].CorrespondingTupleField); 3701Assert.Equal("b", yType.TupleElements[2].Name); 3702Assert.True(yType.TupleElements[2].IsExplicitlyNamedTupleElement); 3703Assert.False(yType.TupleElements[2].CorrespondingTupleField.IsExplicitlyNamedTupleElement); 4478AssertEx.Equal(new[] { "T1 (T1, T2).Item1", "T2 (T1, T2).Item2" }, vt2.TupleElements.ToTestDisplayStrings()); 4479vt2.TupleElements.All(e => verifyTupleErrorField(e)); 5889var elements = tuple.TupleElements; 6041Assert.All(tuple8WithoutNames.TupleElements.Select(f => f.Locations.FirstOrDefault()), 6405return tuple.TupleElements.Select(t => t.Type.ToTestDisplayString()); 6549var types = tupleWithoutNames.TupleElements.SelectAsArray(e => e.Type); 6717var elementTypes = tuple1.TupleElements.SelectAsArray(e => e.Type); 6758var elementTypes = tuple1.TupleElements.SelectAsArray(e => e.Type); 6866var elementTypes = tuple1.TupleElements.SelectAsArray(e => e.Type); 6905var elementTypes = tuple1.TupleElements.SelectAsArray(e => e.Type);
Microsoft.CodeAnalysis.CSharp.Features (11)
Completion\CompletionProviders\TupleNameCompletionProvider.cs (2)
95if (index >= type.TupleElements.Length) 104var field = type.TupleElements[index];
IntroduceVariable\CSharpIntroduceLocalForExpressionCodeRefactoringProvider.cs (2)
103var localTypesAndDesignations = tupleType.TupleElements.SelectAsArray((field, index, _) => 106if (field.Name == tupleUnderlyingType.TupleElements[index].Name)
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (1)
183foreach (var element in tupleType.TupleElements)
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (3)
168if (type is not INamedTypeSymbol { IsTupleType: true, TupleElements.Length: >= 2 } tupleTypeOpt) 173foreach (var element in tupleType.TupleElements) 212foreach (var element in tupleType.TupleElements)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (1)
61if (targetType is not INamedTypeSymbol { IsTupleType: true, TupleElements: var tupleElements })
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
162[.. tupleType.TupleElements.Select(
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
168var elements = ((INamedTypeSymbol)typeSymbol).TupleElements;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (6)
Compilation\SemanticModelAPITests.cs (6)
4503Assert.Equal(2, type.TupleElements.Length); 4504Assert.Equal(SpecialType.System_String, type.TupleElements[0].Type.SpecialType); 4505Assert.Equal(SpecialType.System_Int32, type.TupleElements[1].Type.SpecialType); 4581Assert.Equal(2, type.TupleElements.Length); 4582Assert.Equal(TypeKind.Class, type.TupleElements[0].Type.TypeKind); 4583Assert.Equal(TypeKind.Class, type.TupleElements[1].Type.TypeKind);
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (2)
45if (tupleType.TupleElements.Length != tuple.Arguments.Count) 53var tupleElementType = tupleType.TupleElements[i].Type;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
231if (symbol.IsTupleType && symbol.TupleElements.Length >= 2) 254foreach (var element in symbol.TupleElements)
Microsoft.CodeAnalysis.Features (11)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (8)
286tupleType.TupleElements.Select(p => p.Type) 466var tupleFieldNames = tupleType.TupleElements.SelectAsArray<IFieldSymbol, string>(f => f.Name); 481var tupleFieldNames = tupleType.TupleElements.SelectAsArray<IFieldSymbol, string>(f => f.Name); 668NamesMatch(comparer, tupleType.TupleElements, childType.TupleElements); 804var fields = tupleType.TupleElements; 857var assignments = tupleType.TupleElements.Select( 886var arguments = tupleType.TupleElements.SelectAsArray<IFieldSymbol, SyntaxNode>(
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
98foreach (var field in symbol.TupleElements)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
86public ImmutableArray<IFieldSymbol> TupleElements => _symbol.TupleElements;
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
66var elements = tupleType.TupleElements;
Microsoft.CodeAnalysis.VisualBasic (3)
SymbolDisplay\SymbolDisplayVisitor.Types.vb (2)
372Return tupleSymbol.TupleElements.Any(Function(e) e.IsExplicitlyNamedTupleElement) 383Dim elements As ImmutableArray(Of IFieldSymbol) = symbol.TupleElements
Symbols\NamedTypeSymbol.vb (1)
1475Private ReadOnly Property INamedTypeSymbol_TupleElements As ImmutableArray(Of IFieldSymbol) Implements INamedTypeSymbol.TupleElements
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (2)
130If symbol.IsTupleType AndAlso symbol.TupleElements.Length >= 2 Then 138Dim elements = symbol.TupleElements
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (7)
CodeGen\CodeGenTuples.vb (7)
6903Return tuple.TupleElements.Select(Function(t) t.Type.ToTestDisplayString()) 7155Dim types = tupleWithoutNames.TupleElements.SelectAsArray(Function(e) e.Type) 7437Dim types = tupleWithoutNames.TupleElements.SelectAsArray(Function(e) e.Type) 7462Dim elements = tuple.TupleElements 7577Dim elementTypes = tuple1.TupleElements.SelectAsArray(Function(e) e.Type) 7670Dim elementTypes = tuple1.TupleElements.SelectAsArray(Function(e) e.Type) 7705Dim elementTypes = tuple1.TupleElements.SelectAsArray(Function(e) e.Type)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (4)
Compilation\CompilationAPITests.vb (4)
1486Assert.True(tupleWithoutNames.TupleElements.All(Function(e) e.IsImplicitlyDeclared)) 1487Assert.Equal({"System.Int32", "System.String"}, tupleWithoutNames.TupleElements.Select(Function(t) t.Type.ToTestDisplayString())) 1502Assert.Equal({"Alice", "Bob"}, tupleWithNames.TupleElements.SelectAsArray(Function(e) e.Name)) 1503Assert.Equal({"System.Int32", "System.String"}, tupleWithNames.TupleElements.Select(Function(t) t.Type.ToTestDisplayString()))
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (1)
SymbolsTests\Source\FieldTests.vb (1)
67Assert.True(fieldType.TupleElements.IsDefault)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (2)
130If symbol.IsTupleType AndAlso symbol.TupleElements.Length >= 2 Then 138Dim elements = symbol.TupleElements
Microsoft.CodeAnalysis.Workspaces (6)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
531: symbols.Where(s => s is not IFieldSymbol).Concat(namedType.TupleElements).ToImmutableArray();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (2)
29foreach (var element in symbol.TupleElements) 43foreach (var element in symbol.TupleElements)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
422var xElements = x.TupleElements; 423var yElements = y.TupleElements;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
165return Hash.Combine(currentHash, Hash.CombineValues(x.TupleElements));
System.Text.Json.SourceGeneration (2)
Helpers\RoslynExtensions.cs (2)
63if (namedType.TupleElements.Length < 2) 68ImmutableArray<ITypeSymbol> erasedElements = namedType.TupleElements