551 references to OfType
ILLink.RoslynAnalyzer (13)
DataFlow\DynamicallyAccessedMembersBinder.cs (7)
122 foreach (var method in type.GetMembers ().OfType<IMethodSymbol> ()) { 151 foreach (var method in type.GetMembers ().OfType<IMethodSymbol> ()) { 194 foreach (var field in type.GetMembers ().OfType<IFieldSymbol> ()) { 230 foreach (var nestedType in type.GetTypeMembers ().OfType<ITypeSymbol> ()) { 253 foreach (var property in type.GetMembers ().OfType<IPropertySymbol> ()) { 302 foreach (var @event in type.GetMembers ().OfType<IEventSymbol> ()) { 383 foreach (var nestedType in type.GetTypeMembers ().OfType<ITypeSymbol> ()) {
DataFlow\LocalDataFlowVisitor.cs (1)
179 var method = assemblyType.GetMembers (methodName).OfType<IMethodSymbol> ().SingleOrDefault ();
RequiresAssemblyFilesAnalyzer.cs (3)
72 var isDynamicCodeSupportedProperty = runtimeFeaturesType.GetMembers ("IsAssemblyFilesSupported").OfType<IPropertySymbol> ().FirstOrDefault (); 89 dangerousPatternsBuilder.AddRange (assemblyType.GetMembers ("GetFile").OfType<IMethodSymbol> ()); 90 dangerousPatternsBuilder.AddRange (assemblyType.GetMembers ("GetFiles").OfType<IMethodSymbol> ());
RequiresDynamicCodeAnalyzer.cs (1)
132 var isDynamicCodeSupportedProperty = runtimeFeaturesType.GetMembers ("IsDynamicCodeSupported").OfType<IPropertySymbol> ().FirstOrDefault ();
RequiresUnreferencedCodeAnalyzer.cs (1)
75 var isDynamicCodeSupportedProperty = runtimeFeaturesType.GetMembers ("IsUnreferencedCodeSupported").OfType<IPropertySymbol> ().FirstOrDefault ();
Microsoft.Analyzers.Extra (17)
AsyncMethodWithoutCancellation.cs (1)
143if (@interface.GetMembers().OfType<IMethodSymbol>()
CallAnalysis\Arrays.cs (2)
86foreach (var method in freezer.GetMembers("ToFrozenDictionary").OfType<IMethodSymbol>().Where(m => m.TypeParameters.Length == 2)) 95foreach (var method in freezer.GetMembers("ToFrozenSet").OfType<IMethodSymbol>().Where(m => m.TypeParameters.Length == 1))
CallAnalysis\CallAnalyzer.Registrar.cs (3)
75foreach (var method in type.GetMembers(m).OfType<IMethodSymbol>()) 153foreach (var prop in type.GetMembers(m).OfType<IPropertySymbol>()) 209foreach (var method in type.GetMembers(m).OfType<IMethodSymbol>())
CallAnalysis\LegacyLogging.cs (7)
22legacyMethods.AddRange(loggerExtensions.GetMembers("LogTrace").OfType<IMethodSymbol>()); 23legacyMethods.AddRange(loggerExtensions.GetMembers("LogDebug").OfType<IMethodSymbol>()); 24legacyMethods.AddRange(loggerExtensions.GetMembers("LogInformation").OfType<IMethodSymbol>()); 25legacyMethods.AddRange(loggerExtensions.GetMembers("LogWarning").OfType<IMethodSymbol>()); 26legacyMethods.AddRange(loggerExtensions.GetMembers("LogError").OfType<IMethodSymbol>()); 27legacyMethods.AddRange(loggerExtensions.GetMembers("LogCritical").OfType<IMethodSymbol>()); 28legacyMethods.AddRange(loggerExtensions.GetMembers("Log").OfType<IMethodSymbol>());
CallAnalysis\StartsEndsWith.cs (2)
22var startsWith = stringType.GetMembers("StartsWith").OfType<IMethodSymbol>() 28var endsWith = stringType.GetMembers("EndsWith").OfType<IMethodSymbol>()
CallAnalysis\ValueTuple.cs (1)
32foreach (var method in type.GetMembers("Create").OfType<IMethodSymbol>())
Utilities\SymbolExtensions.cs (1)
67foreach (var member in iface.GetMembers().OfType<IMethodSymbol>())
Microsoft.Analyzers.Extra.Tests (2)
Resources\RoslynTestUtils.cs (2)
362var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution; 456var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.Analyzers.Local (5)
CallAnalysis\CallAnalyzer.Registrar.cs (3)
75foreach (var method in type.GetMembers(m).OfType<IMethodSymbol>()) 153foreach (var prop in type.GetMembers(m).OfType<IPropertySymbol>()) 209foreach (var method in type.GetMembers(m).OfType<IMethodSymbol>())
CallAnalysis\ToInvariantString.cs (2)
30foreach (var method in reg.Compilation.GetSpecialType(type).GetMembers("ToString").OfType<IMethodSymbol>()) 47var invariantCulture = cultureInfo?.GetMembers("InvariantCulture").OfType<IPropertySymbol>().SingleOrDefault();
Microsoft.Analyzers.Local.Tests (2)
Resources\RoslynTestUtils.cs (2)
363var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution; 457var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.AspNetCore.Analyzer.Testing (1)
CodeFixRunner.cs (1)
64return Assert.Single(operations.OfType<ApplyChangesOperation>()).ChangedSolution;
Microsoft.AspNetCore.App.Analyzers (4)
Authorization\AddAuthorizationBuilderAnalyzer.cs (1)
45.OfType<IMethodSymbol>()
Authorization\AuthorizationOptionsTypes.cs (2)
22var authorizationOptionsProperties = authorizationOptionsMembers.OfType<IPropertySymbol>(); 31GetPolicy = authorizationOptionsMembers.OfType<IMethodSymbol>()
RouteEmbeddedLanguage\Infrastructure\RoutePatternParametersDetector.cs (1)
69ITypeSymbol typeSymbol => typeSymbol.GetMembers().OfType<IPropertySymbol>().ToImmutableArray().As<ISymbol>(),
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentParameterAnalyzer.cs (1)
146.OfType<IFieldSymbol>()
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Helpers\CodeFixVerifier.Helper.cs (1)
29var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Helpers\CodeFixVerifier.Helper.cs (1)
29var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
StaticRouteHandlerModel\EndpointParameter.cs (1)
473var properties = type.GetMembers().OfType<IPropertySymbol>().Where(property => property.DeclaredAccessibility == Accessibility.Public);
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
SymbolApiResponseMetadataProvider.cs (1)
123foreach (var conventionMethod in conventionType.GetMembers().OfType<IMethodSymbol>())
Microsoft.CodeAnalysis (6)
CodeGen\PrivateImplementationDetails.cs (1)
414return _orderedProxyTypes.OfType<ExplicitSizeStruct>();
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1093var suppressors = this.Analyzers.OfType<DiagnosticSuppressor>();
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (2)
104_suppressors = analyzers.OfType<DiagnosticSuppressor>().ToImmutableArrayOrEmpty(); 376var suppressorsInAnalysisScope = analysisScope.Analyzers.OfType<DiagnosticSuppressor>().ToImmutableHashSet();
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (2)
820return _codeBlockStartActions.OfType<CodeBlockStartAnalyzerAction<TLanguageKindEnum>>().ToImmutableArray(); 825return _syntaxNodeActions.OfType<SyntaxNodeAnalyzerAction<TLanguageKindEnum>>().ToImmutableArray();
Microsoft.CodeAnalysis.CodeStyle (17)
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (2)
80foreach (var whereMethodSymbol in enumerableType.GetMembers(nameof(Enumerable.Where)).OfType<IMethodSymbol>()) 99foreach (var method in enumerableType.GetMembers().OfType<IMethodSymbol>())
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
38.OfType<IMethodSymbol>()
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
88.OfType<IMethodSymbol>()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamespaceOrTypeSymbolExtensions.cs (1)
29: symbol.GetMembers(WellKnownMemberNames.Indexer).OfType<IPropertySymbol>().Where(p => p.IsIndexer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IPropertySymbolExtensions.cs (1)
13.OfType<IFieldSymbol>()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (4)
550return ((INamedTypeSymbol)symbol).GetMembers().OfType<IPropertySymbol>().Where(p => p.CanBeReferencedByName); 654var getAwaiters = potentialGetAwaiters.OfType<IMethodSymbol>().Where(x => !x.Parameters.Any()); 671if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null)) 676var methods = returnType.GetMembers().OfType<IMethodSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (3)
440return types.SelectMany(x => x.GetMembers().OfType<T>().Where(m => m.IsAccessibleWithin(within))); 505return types.SelectMany(x => x.GetMembers().OfType<T>().Where(m => m.IsAccessibleWithin(within))); 515return types.SelectMany(x => x.GetMembers(memberName).OfType<T>().Where(m => m.IsAccessibleWithin(within)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
195builder.AddRange(dataFlow.Captured.OfType<ILocalSymbol>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (2)
22var properties = symbol.GetMembers().OfType<IPropertySymbol>().ToImmutableArray(); 39var contextualProperties = contextualSymbol?.GetMembers().OfType<IPropertySymbol>().ToImmutableArray() ?? [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
23.OfType<IFieldSymbol>()
Microsoft.CodeAnalysis.CodeStyle.Fixes (15)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
124var candidates = semanticModel.GetMemberGroup(expression, cancellationToken).OfType<IMethodSymbol>().ToImmutableArray();
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (1)
83.OfType<IMethodSymbol>();
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
219if (!ContainingType.Interfaces.OfType<INamedTypeSymbol>().Contains(TypeToGenerateIn))
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
321constraints.OfType<INamedTypeSymbol>().FirstOrDefault() ??
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (2)
27.OfType<IFieldSymbol>() 33.OfType<IPropertySymbol>()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (2)
176foreach (var field in enumType.GetMembers().OfType<IFieldSymbol>()) 195foreach (var field in enumType.GetMembers().OfType<IFieldSymbol>())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
158.OfType<IFieldSymbol>()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
456members.OfType<INamedTypeSymbol>().Select(n => n.ToCodeGenerationSymbol()).ToImmutableArray(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
101? this.GetMembers(WellKnownMemberNames.DelegateInvokeName).OfType<IMethodSymbol>().FirstOrDefault() 174this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)); 184this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
79.OfType<IMethodSymbol>() 506.OfType<IFieldSymbol>()
Microsoft.CodeAnalysis.CSharp (19)
Binder\Imports.cs (1)
142expandedNamespace = expandedNamespace.GetMembers(nameParts[i]).OfType<NamespaceSymbol>().Single();
Compilation\CSharpCompilation.cs (2)
4966AddCache(container.GetMembers(declaration.Name).OfType<NamespaceOrTypeSymbol>()); 4983_cache[mergedNamespace.ConstituentNamespaces.OfType<SourceNamespaceSymbol>().First().MergedDeclaration] = symbol;
Declarations\DeclarationTable.Cache.cs (1)
85MergedRoot.Declarations.OfType<RootSingleNamespaceDeclaration>().SelectMany(r => r.ReferenceDirectives).AsImmutable());
Lowering\SyntheticBoundNodeFactory.cs (1)
260receiverOpt.Type.GetMembers(propertySym.Name).OfType<PropertySymbol>().Single() == propertySym);
SymbolDisplay\SymbolDisplayVisitor.Types.cs (1)
465var members = string.Join(", ", symbol.GetMembers().OfType<IPropertySymbol>().Select(CreateAnonymousTypeMember));
Symbols\MergedNamespaceSymbol.cs (2)
236return ImmutableArray.CreateRange<NamedTypeSymbol>(GetMembersUnordered().OfType<NamedTypeSymbol>()); 241return ImmutableArray.CreateRange<NamedTypeSymbol>(GetMembers().OfType<NamedTypeSymbol>());
Symbols\NamespaceOrTypeSymbol.cs (1)
409symbols = namespaceOrType.GetMembers(name).OfType<NamespaceOrTypeSymbol>();
Symbols\NamespaceSymbol.cs (1)
40return this.GetMembers().OfType<NamespaceSymbol>();
Symbols\Source\SourceMemberContainerSymbol.cs (1)
2665foreach (var method in this.GetMembers(name).OfType<MethodSymbol>())
Symbols\Source\SourceNamedTypeSymbol.cs (2)
1854foreach (var slice in GetMembers(WellKnownMemberNames.SliceMethodName).OfType<MethodSymbol>()) 1870foreach (var conversion in GetMembers().OfType<SourceUserDefinedConversionSymbol>())
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (1)
226internal override IEnumerable<FieldSymbol> GetFieldsToEmit() => _members.OfType<FieldSymbol>();
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (1)
908internal override IEnumerable<FieldSymbol> GetFieldsToEmit() => _members.OfType<FieldSymbol>();
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (1)
67ContainingType.GetMembersUnordered().OfType<SynthesizedRecordObjEquals>().Single(),
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (1)
105MethodSymbol? baseEquals = ContainingType.GetMembersUnordered().OfType<SynthesizedRecordBaseEquals>().Single().OverriddenMethod;
Symbols\Synthesized\Records\SynthesizedRecordInequalityOperator.cs (1)
41F.CloseMethod(F.Block(F.Return(F.Not(F.Call(receiver: null, ContainingType.GetMembers(WellKnownMemberNames.EqualityOperatorName).OfType<SynthesizedRecordEqualityOperator>().Single(),
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (1)
115return compilation.SourceModule.GlobalNamespace.GetTypeMembers(WellKnownMemberNames.TopLevelStatementsEntryPointTypeName).OfType<SourceNamedTypeSymbol>().SingleOrDefault(s => s.IsSimpleProgram);
Microsoft.CodeAnalysis.CSharp.CodeStyle (9)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
80.OfType<IFieldSymbol>()
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (4)
47.OfType<IMethodSymbol>() 71.OfType<IMethodSymbol>() 103.OfType<IMethodSymbol>() 158.OfType<IMethodSymbol>()
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (3)
28.OfType<IPropertySymbol>() 129.OfType<IPropertySymbol>() 146.OfType<IMethodSymbol>()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
32return results.OfType<ITypeSymbol>();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
107.OfType<IFieldSymbol>()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
112var primaryConstructor = members.OfType<IMethodSymbol>().FirstOrDefault(m => CodeGenerationConstructorInfo.GetIsPrimaryConstructor(m));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
553var indexers = type.GetMembers().OfType<IPropertySymbol>()
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
SymbolKey\SymbolKeyTests.cs (1)
169var method = type.GetMembers("GetValue").OfType<IMethodSymbol>().Single();
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (15)
CodeGen\CodeGenDeconstructTests.cs (1)
260.OfType<SourceOrdinaryMethodSymbol>().Where(m => m.ParameterCount == 2).Single();
CodeGen\CodeGenTupleTest.cs (14)
5883Assert.All(tupleWithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 5960Assert.All(tupleWithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 5979Assert.All(tupleWithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 5998Assert.All(tupleWithSomeNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 6016Assert.All(tupleWithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 6068Assert.All(tuple8WithoutNames.GetMembers().OfType<IFieldSymbol>().Where(f => f.Name != "Rest").Select(f => f.Locations.FirstOrDefault()), 6093Assert.All(tuple8WithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 6118Assert.All(tuple9WithoutNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 6144Assert.All(tuple9WithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 6176Assert.All(tuple9WithNames.GetMembers().OfType<IFieldSymbol>().Select(f => f.Locations.FirstOrDefault()), 12695var m1Tuple = model.LookupSymbols(node.SpanStart, name: "v1").OfType<ILocalSymbol>().Single().Type.GetSymbol<NamedTypeSymbol>(); 12696var m2Tuple = model.LookupSymbols(node.SpanStart, name: "v2").OfType<ILocalSymbol>().Single().Type.GetSymbol<NamedTypeSymbol>(); 12697var m6Tuple = model.LookupSymbols(node.SpanStart, name: "v6").OfType<ILocalSymbol>().Single().Type.GetSymbol<NamedTypeSymbol>(); 22859AssertEx.SetEqual(xSymbol.GetMembers().OfType<IFieldSymbol>().Select(f => f.Name),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (88)
Diagnostics\GetDiagnosticsTests.cs (1)
1721foreach (var field in namedType.GetMembers().OfType<IFieldSymbol>())
Semantics\PrimaryConstructorTests.cs (87)
7837var capturedParameters = comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters(); 8702Assert.Empty(((CSharpCompilation)verifier.Compilation).GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 9885Assert.Empty(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 9945Assert.Equal(1, comp.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 9946Assert.Empty(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 9998Assert.Empty(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 9999Assert.Equal(1, comp.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10000Assert.Equal(1, comp.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10001Assert.Equal(2, comp.GetTypeByMetadataName("C4").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10020Assert.Equal(1, comp.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10047Assert.Equal(2, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10149Assert.Equal(1, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 10192Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10227Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10270Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10308Assert.NotEmpty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10339Assert.NotEmpty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10379Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10415Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10451Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10490Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10529Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10565Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10601Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10640Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10679Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10718Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10754Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10790Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10830Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10877Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10921Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 10961Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11004Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11051Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11093Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11138Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11173Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11203Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11238Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11268Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11303Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11334Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11370Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11401Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11444Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11483Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11522Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11562Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11605Assert.Empty(comp.GetTypeByMetadataName("Color+C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11795Assert.Equal(isStatic, comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().IsEmpty()); 11839Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11840Assert.Empty(comp.GetTypeByMetadataName("S2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11841Assert.NotEmpty(comp.GetTypeByMetadataName("S3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11913Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11949Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 11992Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12040Assert.Equal("System.String P1", comp1.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Single().Key.ToTestDisplayString()); 12041Assert.Equal("System.Int32 p2", comp1.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Single().Key.ToTestDisplayString()); 12042Assert.Equal(2, comp1.GetTypeByMetadataName("C3").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters().Count); 12072Assert.Empty(comp2.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12073Assert.Empty(comp2.GetTypeByMetadataName("C2").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12113Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12157Assert.Empty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 12203Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 14619Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 14815Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15016Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15242Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 15553Assert.All(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetBackingFields(), f => Assert.True(f.IsReadOnly)); 16378Assert.NotEmpty(comp.GetTypeByMetadataName("S1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 19754Assert.Single(comp.GetTypeByMetadataName("C1").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 20209Assert.Empty(comp.GetTypeByMetadataName("C").InstanceConstructors.OfType<SynthesizedPrimaryConstructor>().Single().GetCapturedParameters()); 20603var namedType = symbols.OfType<INamedTypeSymbol>().Single(); 20604var primaryConstructor = symbols.OfType<IMethodSymbol>().Single(); 20637var namedType1 = symbols1.OfType<INamedTypeSymbol>().Single(); 20638var primaryConstructor1 = symbols1.OfType<IMethodSymbol>().Single(); 20647var namedType2 = symbols2.OfType<INamedTypeSymbol>().Single(); 20681var namedType1 = symbols1.OfType<INamedTypeSymbol>().Single(); 20682var primaryConstructor1 = symbols1.OfType<IMethodSymbol>().Single(); 20691var namedType2 = symbols2.OfType<INamedTypeSymbol>().Single(); 20728var namedType1 = symbols1.OfType<INamedTypeSymbol>().Single(); 20736var namedType2 = symbols2.OfType<INamedTypeSymbol>().Single(); 20737var primaryConstructor2 = symbols2.OfType<IMethodSymbol>().Single(); 20778var namedType1 = symbols1.OfType<INamedTypeSymbol>().Single(); 20779var primaryConstructor1 = symbols1.OfType<IMethodSymbol>().Single(); 20788var namedType2 = symbols2.OfType<INamedTypeSymbol>().Single();
Microsoft.CodeAnalysis.CSharp.Features (20)
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (3)
134.OfType<IMethodSymbol>() 321MethodDeclarationSyntax method => namedType.GetMembers(method.Identifier.ValueText).OfType<IMethodSymbol>().ToImmutableArray(), 322ConstructorDeclarationSyntax constructor => namedType.GetMembers(WellKnownMemberNames.InstanceConstructorName).OfType<IMethodSymbol>().ToImmutableArray(),
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (2)
189var fields = type.GetMembers().OfType<IFieldSymbol>().Where(f => f.IsConst).Where(f => f.HasConstantValue); 337? DocumentationCommentId.GetSymbolsForDeclarationId(documentation.CompletionListCref, compilation).OfType<INamedTypeSymbol>().FirstOrDefault()
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (2)
194var indexers = semanticModel.LookupSymbols(position, expressionType, WellKnownMemberNames.Indexer).OfType<IPropertySymbol>(); 257var methodGroup = semanticModel.GetMemberGroup(invocationExpression.Expression, cancellationToken).OfType<IMethodSymbol>();
GenerateEqualsAndGetHashCodeFromMembers\CSharpGenerateEqualsAndGetHashCodeService.cs (1)
28SyntaxFactory.Block(statements.OfType<StatementSyntax>()))];
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (2)
186.OfType<IPropertySymbol>() 220.OfType<IPropertySymbol>()
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (1)
92.OfType<IMethodSymbol>()
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
80.OfType<IFieldSymbol>()
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (4)
47.OfType<IMethodSymbol>() 71.OfType<IMethodSymbol>() 103.OfType<IMethodSymbol>() 158.OfType<IMethodSymbol>()
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (3)
28.OfType<IPropertySymbol>() 129.OfType<IPropertySymbol>() 146.OfType<IMethodSymbol>()
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
107.OfType<IFieldSymbol>()
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (22)
Semantics\LookupTests.cs (1)
2008var ms = comp.GlobalNamespace.GetTypeMembers("Program").Single().GetMembers("M").OfType<MethodSymbol>();
Semantics\NullableReferenceTypesTests.cs (21)
12345foreach (var ev in type.GetMembers().OfType<EventSymbol>()) 12713foreach (var ev in type.GetMembers().OfType<EventSymbol>()) 12801foreach (var ev in type.GetMembers().OfType<EventSymbol>()) 12883foreach (var member in compilation.GetTypeByMetadataName("B1").GetMembers().OfType<PropertySymbol>()) 12888foreach (var member in compilation.GetTypeByMetadataName("B2").GetMembers().OfType<PropertySymbol>()) 12897foreach (var property in type.GetMembers().OfType<PropertySymbol>()) 13033foreach (var member in compilation.GetTypeByMetadataName("IA").GetMembers().OfType<PropertySymbol>()) 13039foreach (var member in compilation.GetTypeByMetadataName("IA2").GetMembers().OfType<PropertySymbol>()) 13049foreach (var property in type.GetMembers().OfType<PropertySymbol>()) 13124foreach (var member in compilation.GetTypeByMetadataName("IA").GetMembers().OfType<PropertySymbol>()) 13130foreach (var member in compilation.GetTypeByMetadataName("IA2").GetMembers().OfType<PropertySymbol>()) 13140foreach (var property in type.GetMembers().OfType<PropertySymbol>()) 16633foreach (var member in compilation.GetTypeByMetadataName(typeName).GetMembers().OfType<PropertySymbol>()) 16639foreach (var member in compilation.GetTypeByMetadataName("B3").GetMembers().OfType<PropertySymbol>()) 16648foreach (var property in type.GetMembers().OfType<PropertySymbol>()) 16718var implemented = compilation.GetTypeByMetadataName(typeName[0]).GetMembers().OfType<PropertySymbol>().Single(); 16724var implemented = compilation.GetTypeByMetadataName("IA3").GetMembers().OfType<PropertySymbol>().Single(); 16733foreach (var property in type.GetMembers().OfType<PropertySymbol>()) 16803var implemented = compilation.GetTypeByMetadataName(typeName[0]).GetMembers().OfType<PropertySymbol>().Single(); 16809var implemented = compilation.GetTypeByMetadataName("IA3").GetMembers().OfType<PropertySymbol>().Single(); 16818foreach (var property in type.GetMembers().OfType<PropertySymbol>())
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (84)
Compilation\CompilationAPITests.cs (6)
2611Assert.Equal(1, type.GetMembers().OfType<IPropertySymbol>().Count()); 2613Assert.All(type.GetMembers().OfType<IPropertySymbol>().Select(p => p.Locations.FirstOrDefault()), 2632Assert.Equal(2, type.GetMembers().OfType<IPropertySymbol>().Count()); 2647Assert.Equal(2, type.GetMembers().OfType<IPropertySymbol>().Count()); 2649Assert.All(type.GetMembers().OfType<IPropertySymbol>().Select(p => p.Locations.FirstOrDefault()), 2714return type.GetMembers().OfType<IPropertySymbol>().SelectAsArray(p =>
Symbols\DefaultInterfaceImplementationTests.cs (39)
14737var p1 = i1.GetMembers().OfType<PropertySymbol>().ElementAt(0); 14760var p2 = i1.GetMembers().OfType<PropertySymbol>().ElementAt(1); 14783var p3 = i1.GetMembers().OfType<PropertySymbol>().ElementAt(2); 14810var p4 = i1.GetMembers().OfType<PropertySymbol>().ElementAt(3); 16341var test1P2 = test1.GetMembers().OfType<PropertySymbol>().Where(p => p.Name.StartsWith("I2.")).Single(); 16367var test1P3 = test1.GetMembers().OfType<PropertySymbol>().Where(p => p.Name.StartsWith("I3.")).Single(); 16592var test1P2 = test1.GetMembers().OfType<PropertySymbol>().Where(p => p.Name.StartsWith(i1.Name)).Single(); 17024var test2P1 = test2.GetMembers().OfType<PropertySymbol>().Where(p => p.Name.StartsWith("I1.")).Single(); 17050var test2P2 = test2.GetMembers().OfType<PropertySymbol>().Where(p => p.Name.StartsWith("I2.")).Single(); 17076var test2P3 = test2.GetMembers().OfType<PropertySymbol>().Where(p => p.Name.StartsWith("I3.")).Single(); 17274var test2P1 = test2.GetMembers().OfType<PropertySymbol>().Where(p => p.Name.StartsWith("I1.")).Single(); 17304var test2P2 = test2.GetMembers().OfType<PropertySymbol>().Where(p => p.Name.StartsWith("I2.")).Single(); 17330var test2P3 = test2.GetMembers().OfType<PropertySymbol>().Where(p => p.Name.StartsWith("I3.")).Single(); 17360var test2P4 = test2.GetMembers().OfType<PropertySymbol>().Where(p => p.Name.StartsWith("I4.")).Single(); 28236var p1 = i1.GetMembers().OfType<EventSymbol>().ElementAt(0); 28263var p2 = i1.GetMembers().OfType<EventSymbol>().ElementAt(1); 28290var p3 = i1.GetMembers().OfType<EventSymbol>().ElementAt(2); 28317var p4 = i1.GetMembers().OfType<EventSymbol>().ElementAt(3); 29734var test1P2 = test1.GetMembers().OfType<EventSymbol>().Where(p => p.Name.StartsWith("I2.")).Single(); 29764var test1P3 = test1.GetMembers().OfType<EventSymbol>().Where(p => p.Name.StartsWith("I3.")).Single(); 30005var test1P2 = test1.GetMembers().OfType<EventSymbol>().Where(p => p.Name.StartsWith(i1.Name)).Single(); 30447var test2P1 = test2.GetMembers().OfType<EventSymbol>().Where(p => p.Name.StartsWith("I1.")).Single(); 30477var test2P2 = test2.GetMembers().OfType<EventSymbol>().Where(p => p.Name.StartsWith("I2.")).Single(); 30507var test2P3 = test2.GetMembers().OfType<EventSymbol>().Where(p => p.Name.StartsWith("I3.")).Single(); 30668var test2P1 = test2.GetMembers().OfType<EventSymbol>().Where(p => p.Name.StartsWith("I1.")).Single(); 30698var test2P2 = test2.GetMembers().OfType<EventSymbol>().Where(p => p.Name.StartsWith("I2.")).Single(); 30728var test2P3 = test2.GetMembers().OfType<EventSymbol>().Where(p => p.Name.StartsWith("I3.")).Single(); 30758var test2P4 = test2.GetMembers().OfType<EventSymbol>().Where(p => p.Name.StartsWith("I4.")).Single(); 67148Assert.Empty(i1.GetMembers().OfType<MethodSymbol>().Single().ExplicitInterfaceImplementations); 67214Assert.Same(i2.GetMembers().OfType<MethodSymbol>().Single(), i1.GetMembers().OfType<MethodSymbol>().Single().ExplicitInterfaceImplementations.Single()); 67330var m = i1.GetMembers().OfType<PropertySymbol>().Single(); 67398var m1 = i1.GetMembers().OfType<PropertySymbol>().Single(); 67399var m2 = i2.GetMembers().OfType<PropertySymbol>().Single(); 67518var m = i1.GetMembers().OfType<EventSymbol>().Single(); 67589var m1 = i1.GetMembers().OfType<EventSymbol>().Single(); 67590var m2 = i2.GetMembers().OfType<EventSymbol>().Single(); 68010foreach (var p in c1.GetMembers().OfType<PropertySymbol>()) 68074foreach (var p in c1.GetMembers().OfType<PropertySymbol>())
Symbols\Metadata\PE\LoadingFields.cs (1)
155var fields = readOnlySpanType.GetMembers().OfType<FieldSymbol>();
Symbols\Metadata\PE\NoPia.cs (3)
1236var varI5_Foo = varI5.GetMembers("Foo").OfType<MethodSymbol>().Single(); 1246var varI7_Foo = varI7.GetMembers("Foo").OfType<MethodSymbol>().Single(); 1247var varI7_Bar = varI7.GetMembers("Bar").OfType<MethodSymbol>().Single();
Symbols\Retargeting\RetargetCustomAttributes.cs (6)
209FieldSymbol testField = testClass.GetMembers("testField").OfType<FieldSymbol>().Single(); 219PropertySymbol testProperty = testClass.GetMembers("TestProperty").OfType<PropertySymbol>().Single(); 233MethodSymbol testMethod = testClass.GetMembers("TestMethod").OfType<MethodSymbol>().Single(); 243MethodSymbol testMethod = testClass.GetMembers("TestMethod").OfType<MethodSymbol>().Single(); 255MethodSymbol testMethod = testClass.GetMembers("TestMethod").OfType<MethodSymbol>().Single(); 267MethodSymbol testMethod = testClass.GetMembers("TestMethod").OfType<MethodSymbol>().Single();
Symbols\Retargeting\RetargetCustomModifiers.cs (8)
47FieldSymbol f0 = modifiers.GetMembers("F0").OfType<FieldSymbol>().Single(); 57MethodSymbol m1 = modifiers.GetMembers("F1").OfType<MethodSymbol>().Single(); 59ParameterSymbol p2 = modifiers.GetMembers("F2").OfType<MethodSymbol>().Single().Parameters[0]; 61MethodSymbol m5 = modifiers.GetMembers("F5").OfType<MethodSymbol>().Single(); 64ParameterSymbol p6 = modifiers.GetMembers("F6").OfType<MethodSymbol>().Single().Parameters[0]; 66MethodSymbol m7 = modifiers.GetMembers("F7").OfType<MethodSymbol>().Single(); 165FieldSymbol volatileFld = modifiers.GetMembers("volatileFld").OfType<FieldSymbol>().Single(); 192MethodSymbol m1 = modifiers.GetMembers("F1").OfType<MethodSymbol>().Single();
Symbols\Source\DeclaringSyntaxNodeTests.cs (4)
238foreach (IFieldSymbol f in c1.GetMembers().OfType<IFieldSymbol>()) 459foreach (IFieldSymbol f in c2.GetMembers().OfType<IFieldSymbol>()) 467foreach (IMethodSymbol m in c2.GetMembers().OfType<IMethodSymbol>()) 475foreach (IFieldSymbol f in c3.GetMembers().OfType<IFieldSymbol>())
Symbols\Source\NullablePublicAPITests.cs (16)
147return c.GetMembers().OfType<IFieldSymbol>().ToArray(); 214return c.GetMembers().OfType<IPropertySymbol>().ToArray(); 288return c.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).ToArray(); 377return c.GetMembers("M1").OfType<IMethodSymbol>().Single().Parameters.ToArray(); 480var members = c.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).ToArray(); 488members = e.GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("M")).Select(m => m.ReduceExtensionMethod(m.Parameters[0].Type)).ToArray(); 637return c.GetMembers().OfType<IEventSymbol>().ToArray(); 693comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 757comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 822comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 889comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("IB")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 4124var o2Result = lookupResults.OfType<ILocalSymbol>().First(l => l.Name == "o2"); 4125var o8Result = lookupResults.OfType<ILocalSymbol>().First(l => l.Name == "o8"); 4129var o1Result = lookupResults.OfType<IParameterSymbol>().First(p => p.Name == "o1"); 4130var oResult = lookupResults.OfType<IParameterSymbol>().First(p => p.Name == "o"); 4134var localFunctionResult = lookupResults.OfType<IMethodSymbol>().First(m => m.MethodKind == MethodKind.LocalFunction);
Symbols\TypeTests.cs (1)
673var fields = v.GetMembers().OfType<FieldSymbol>().ToList();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
Extensions.cs (2)
203return type.GetMembers("Equals").OfType<IMethodSymbol>().Single(m => m.Parameters is [{ Type: var parameterType }] && parameterType.Equals(type, SymbolEqualityComparer.Default)); 214return primaryConstructor.ContainingType.GetMembers("Deconstruct").OfType<IMethodSymbol>().Single(
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (1)
328originalSemanticModel, namespaceId.Value, semanticModel.LookupNamespacesAndTypes(token.SpanStart).OfType<IAliasSymbol>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
32return results.OfType<ITypeSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
112var primaryConstructor = members.OfType<IMethodSymbol>().FirstOrDefault(m => CodeGenerationConstructorInfo.GetIsPrimaryConstructor(m));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
553var indexers = type.GetMembers().OfType<IPropertySymbol>()
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
CodeGeneration\SyntaxGeneratorTests.cs (5)
989var conversion = gcHandleType.GetMembers().OfType<IMethodSymbol>().Single(m => 997conversion = doubleType.GetMembers().OfType<IMethodSymbol>().Single(m => 4278var method = symbolC.GetMembers().OfType<IMethodSymbol>().Single(m => m.MethodKind == MethodKind.Ordinary); 4279var indexer = symbolC.GetMembers().OfType<IPropertySymbol>().Single(m => m.IsIndexer); 4280var property = symbolC.GetMembers().OfType<IPropertySymbol>().Single(m => !m.IsIndexer);
Microsoft.CodeAnalysis.EditorFeatures (3)
CodeActions\CodeActionEditHandlerService.cs (3)
180var updatedSolution = operations.OfType<ApplyChangesOperation>().FirstOrDefault()?.ChangedSolution ?? oldSolution; 296var navigationOperation = operations.OfType<DocumentNavigationOperation>().FirstOrDefault(); 305var renameOperation = operations.OfType<StartInlineRenameSessionOperation>().FirstOrDefault();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeGeneration\CodeGenerationTests.CSharp.cs (2)
681getExplicitInterfaces: s => s.LookupSymbols(input.IndexOf('M'), null, "M").OfType<IMethodSymbol>().ToImmutableArray()); 699getExplicitInterfaces: s => s.LookupSymbols(input.IndexOf('M'), null, "M").OfType<IMethodSymbol>().ToImmutableArray());
CodeGeneration\CodeGenerationTests.VisualBasic.cs (1)
647getExplicitInterfaces: s => s.LookupSymbols(input.IndexOf('M'), null, "M").OfType<IMethodSymbol>().ToImmutableArray());
Microsoft.CodeAnalysis.Features (30)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
160if (!typeSymbol.GetMembers().OfType<IMethodSymbol>().Any(IsDebuggerDisplayMethod))
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
533foreach (var methodSymbol in typeSymbol.GetMembers().OfType<IMethodSymbol>())
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (1)
382var methodSymbols = containerSymbol.GetMembers(methodName).OfType<IMethodSymbol>();
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
323var originalProperties = anonymousType.GetMembers().OfType<IPropertySymbol>().ToImmutableArray();
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
59var fields = propertySymbol.ContainingType.GetMembers().OfType<IFieldSymbol>();
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (1)
62from method in regexType.GetMembers().OfType<IMethodSymbol>()
FullyQualify\AbstractFullyQualifyService.cs (2)
134.OfType<INamedTypeSymbol>() 176.OfType<INamespaceSymbol>()
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.cs (1)
114var applyChangesOperation = operations.OfType<ApplyChangesOperation>().SingleOrDefault();
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (3)
127.OfType<IMethodSymbol>() 159.OfType<IMethodSymbol>() 163.OfType<IMethodSymbol>()
QuickInfo\QuickInfoServiceWithProviders.cs (1)
77foreach (var provider in GetProviders().OfType<CommonQuickInfoProvider>())
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
101.OfType<IMethodSymbol>()
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (2)
145.OfType<IMethodSymbol>() 155.OfType<IMethodSymbol>()
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (2)
80foreach (var whereMethodSymbol in enumerableType.GetMembers(nameof(Enumerable.Where)).OfType<IMethodSymbol>()) 99foreach (var method in enumerableType.GetMembers().OfType<IMethodSymbol>())
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
38.OfType<IMethodSymbol>()
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
88.OfType<IMethodSymbol>()
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
124var candidates = semanticModel.GetMemberGroup(expression, cancellationToken).OfType<IMethodSymbol>().ToImmutableArray();
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (1)
83.OfType<IMethodSymbol>();
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
219if (!ContainingType.Interfaces.OfType<INamedTypeSymbol>().Contains(TypeToGenerateIn))
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
321constraints.OfType<INamedTypeSymbol>().FirstOrDefault() ??
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (2)
27.OfType<IFieldSymbol>() 33.OfType<IPropertySymbol>()
StackTraceExplorer\StackFrameMethodSymbolResolver.cs (1)
26.OfType<IMethodSymbol>()
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
146var applyChangesOperation = operations.OfType<ApplyChangesOperation>().SingleOrDefault();
UnusedReferences\UnusedReferencesRemover.cs (2)
48.OfType<PortableExecutableReference>() 55.OfType<CompilationReference>()
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Features\CodeFixes\CodeFixService.cs (1)
810var fixer = lazyConfigurationProviders.Value.OfType<AbstractSuppressionCodeFixProvider>().FirstOrDefault();
Handler\CodeActions\CodeActionHelpers.cs (2)
194var fixAllFlavors = unifiedCodeFixSuggestedAction.FixAllFlavors.Actions.OfType<UnifiedFixAllCodeFixSuggestedAction>().Select(action => action.FixAllState.Scope.ToString()); 378var fixAllFlavor = unifiedCodeFixSuggestedAction.FixAllFlavors.Actions.OfType<UnifiedFixAllCodeFixSuggestedAction>().Where(action => action.FixAllState.Scope.ToString() == fixAllScope).First();
Microsoft.CodeAnalysis.Rebuild (1)
CompilationFactory.cs (1)
184.OfType<IMethodSymbol>();
Microsoft.CodeAnalysis.VisualBasic (13)
Binding\Binder_InterpolatedString.vb (1)
145node.Contents.OfType(Of BoundInterpolation)().Any(
Declarations\DeclarationTreeBuilder.vb (1)
223Dim newChildren = globalChildren.OfType(Of SingleNamespaceOrTypeDeclaration).AsImmutable()
Declarations\MergedTypeDeclaration.vb (2)
148allSingleTypeDecls = Declarations(0).Children.OfType(Of SingleTypeDeclaration)() 150allSingleTypeDecls = Declarations.SelectMany(Function(d) d.Children.OfType(Of SingleTypeDeclaration)())
SymbolDisplay\SymbolDisplayVisitor.Types.vb (1)
326Dim members = String.Join(", ", symbol.GetMembers().OfType(Of IPropertySymbol).Select(Function(p) CreateAnonymousTypeMember(p)))
Symbols\MergedNamespaceSymbol.vb (3)
312Return ImmutableArray.CreateRange(Of NamedTypeSymbol)(GetMembersUnordered().OfType(Of NamedTypeSymbol)) 316Return ImmutableArray.CreateRange(Of NamedTypeSymbol)(GetMembers().OfType(Of NamedTypeSymbol)) 321Return ImmutableArray.CreateRange(Of NamedTypeSymbol)(GetMembers(name).OfType(Of NamedTypeSymbol))
Symbols\NamespaceOrTypeSymbol.vb (1)
260symbols = namespaceOrType.GetMembers(namePart).OfType(Of NamespaceOrTypeSymbol)()
Symbols\NamespaceSymbol.vb (3)
34Return Me.GetMembers().OfType(Of NamespaceSymbol)() 540Return Me.GetMembers().OfType(Of INamespaceOrTypeSymbol)() 544Return Me.GetMembers(name).OfType(Of INamespaceOrTypeSymbol)()
Symbols\SubstitutedNamedType.vb (1)
357Dim methodSubstitutions = members.OfType(Of MethodSymbol)().ToDictionary(Function(m) m, Function(m) SubstituteTypeParametersForMemberMethod(m))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (1)
27For Each method In DirectCast(context.Symbol, INamedTypeSymbol).GetMembers().OfType(Of IMethodSymbol)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (1)
179For Each candidateSymbol In candidateSymbols.OfType(Of IMethodSymbol)()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\PropertyGenerator.vb (1)
150Return SyntaxFactory.List(statementsOpt.OfType(Of StatementSyntax))
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (11)
CodeGen\CodeGenTuples.vb (11)
6898Assert.All(tupleWithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()), 6951Assert.All(tupleWithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()), 6971Assert.All(tupleWithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()), 6992Assert.All(tupleWithSomeNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()), 7010Assert.All(tupleWithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()), 7035Assert.All(tuple8WithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()), 7060Assert.All(tuple8WithNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()), 7085Assert.All(tuple9WithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()), 7110Assert.All(tuple9WithNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()), 7135Assert.All(tuple9WithNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()), 7159Assert.All(tupleWithoutNames.GetMembers().OfType(Of IFieldSymbol)().Select(Function(f) f.Locations.FirstOrDefault()),
Microsoft.CodeAnalysis.VisualBasic.Features (10)
CodeRefactorings\NodeSelectionHelpers.vb (1)
47If selectedMembers.OfType(Of IncompleteMemberSyntax)().Any() Then
Completion\CompletionProviders\OverrideCompletionProvider.vb (3)
159Dim finalizeMethod = members.OfType(Of IMethodSymbol)().Where(Function(x) x.Name = "Finalize" AndAlso OverridesObjectMethod(x)).SingleOrDefault() 166Dim filteredMembers = members.OfType(Of IMethodSymbol)().Where(Function(m) Not m.ReturnsVoid) 178Dim filteredMembers = members.OfType(Of IMethodSymbol)().Where(Function(m) m.ReturnsVoid)
Completion\KeywordRecommenders\Declarations\OfKeywordRecommender.vb (1)
111Return symbols.OfType(Of INamedTypeSymbol)() _
NavigationBar\VisualBasicNavigationBarItemService.vb (2)
322Dim accessibleEvents = semanticModel.LookupSymbols(position, eventType).OfType(Of IEventSymbol).OrderBy(Function(e) e.Name) 324Dim methodsImplementingEvents = containingType.GetMembers().OfType(Of IMethodSymbol) _
SignatureHelp\FunctionAggregationSignatureHelpProvider.vb (1)
68includeReducedExtensionMethods:=True).OfType(Of IMethodSymbol).
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (1)
27For Each method In DirectCast(context.Symbol, INamedTypeSymbol).GetMembers().OfType(Of IMethodSymbol)
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (1)
179For Each candidateSymbol In candidateSymbols.OfType(Of IMethodSymbol)()
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (11)
Compilation\CompilationAPITests.vb (10)
1591Assert.Equal(2, type.GetMembers().OfType(Of IPropertySymbol).Count()) 1593Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()), 1613Assert.Equal(2, type.GetMembers().OfType(Of IPropertySymbol).Count()) 1638Assert.Equal(1, type.GetMembers().OfType(Of IPropertySymbol).Count()) 1640Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()), 1653Assert.Equal(1, type.GetMembers().OfType(Of IPropertySymbol).Count()) 1655Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()), 1667Assert.Equal(2, type.GetMembers().OfType(Of IPropertySymbol).Count()) 1669Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()), 1730Return type.GetMembers().OfType(Of IPropertySymbol)().SelectAsArray(Function(p) p.NullableAnnotation)
Diagnostics\GetDiagnosticsTests.vb (1)
722For Each field In namedType.GetMembers().OfType(Of IFieldSymbol)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (8)
SymbolsTests\Retargeting\RetargetCustomModifiers.vb (8)
38Dim f0 As FieldSymbol = modifiers.GetMembers("F0").OfType(Of FieldSymbol)().Single() 44Dim m1 As MethodSymbol = modifiers.GetMembers("F1").OfType(Of MethodSymbol)().Single() 46Dim p2 As ParameterSymbol = modifiers.GetMembers("F2").OfType(Of MethodSymbol)().Single().Parameters(0) 47Dim m5 As MethodSymbol = modifiers.GetMembers("F5").OfType(Of MethodSymbol)().Single() 49Dim p6 As ParameterSymbol = modifiers.GetMembers("F6").OfType(Of MethodSymbol)().Single().Parameters(0) 50Dim m7 As MethodSymbol = modifiers.GetMembers("F7").OfType(Of MethodSymbol)().Single() 117Dim volatileFld As FieldSymbol = modifiers.GetMembers("volatileFld").OfType(Of FieldSymbol)().Single() 135Dim m1 As MethodSymbol = modifiers.GetMembers("F1").OfType(Of MethodSymbol)().Single()
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
Recommendations\VisualBasicRecommendationServiceRunner.vb (2)
484.OfType(Of INamedTypeSymbol)() _ 532.OfType(Of INamedTypeSymbol)() _
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\PropertyGenerator.vb (1)
150Return SyntaxFactory.List(statementsOpt.OfType(Of StatementSyntax))
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.vb (2)
1066Dim Conversion = gcHandleType.GetMembers().OfType(Of IMethodSymbol)().Single( 1075Conversion = doubleType.GetMembers().OfType(Of IMethodSymbol)().Single(
Microsoft.CodeAnalysis.Workspaces (39)
Diagnostics\Extensions.cs (1)
381var suppressionAnalyzer = hostAnalyzers.OfType<IPragmaSuppressionsAnalyzer>().FirstOrDefault();
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (1)
27.OfType<IFieldSymbol>()
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (1)
217.OfType<IMethodSymbol>()
Recommendations\AbstractRecommendationServiceRunner.cs (3)
294.OfType<INamespaceSymbol>().FirstOrDefault(); 302var aliases = semanticModel.LookupSymbols(_context.Position, container).OfType<IAliasSymbol>().Where(a => systemNamespace.Equals(a.Target)); 327var aliases = _context.SemanticModel.LookupSymbols(_context.Position, container).OfType<IAliasSymbol>().Where(a => specialTypeSymbol.Equals(a.Target));
Rename\ConflictEngine\DeclarationConflictHelpers.cs (2)
19.OfType<IMethodSymbol>() 30.OfType<IPropertySymbol>()
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
205foreach (var method in namedType.GetMembers().OfType<IMethodSymbol>())
Shared\Extensions\ITypeSymbolExtensions.cs (2)
144from member in typeSymbol.GetMembers().OfType<TSymbol>() 167from member in baseType.GetMembers(constructedInterfaceMember.Name).OfType<TSymbol>()
Shared\Extensions\SemanticModelExtensions.cs (1)
62.OfType<IMethodSymbol>()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamespaceOrTypeSymbolExtensions.cs (1)
29: symbol.GetMembers(WellKnownMemberNames.Indexer).OfType<IPropertySymbol>().Where(p => p.IsIndexer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IPropertySymbolExtensions.cs (1)
13.OfType<IFieldSymbol>()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (4)
550return ((INamedTypeSymbol)symbol).GetMembers().OfType<IPropertySymbol>().Where(p => p.CanBeReferencedByName); 654var getAwaiters = potentialGetAwaiters.OfType<IMethodSymbol>().Where(x => !x.Parameters.Any()); 671if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null)) 676var methods = returnType.GetMembers().OfType<IMethodSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (3)
440return types.SelectMany(x => x.GetMembers().OfType<T>().Where(m => m.IsAccessibleWithin(within))); 505return types.SelectMany(x => x.GetMembers().OfType<T>().Where(m => m.IsAccessibleWithin(within))); 515return types.SelectMany(x => x.GetMembers(memberName).OfType<T>().Where(m => m.IsAccessibleWithin(within)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
195builder.AddRange(dataFlow.Captured.OfType<ILocalSymbol>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (2)
22var properties = symbol.GetMembers().OfType<IPropertySymbol>().ToImmutableArray(); 39var contextualProperties = contextualSymbol?.GetMembers().OfType<IPropertySymbol>().ToImmutableArray() ?? [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
23.OfType<IFieldSymbol>()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (2)
176foreach (var field in enumType.GetMembers().OfType<IFieldSymbol>()) 195foreach (var field in enumType.GetMembers().OfType<IFieldSymbol>())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
158.OfType<IFieldSymbol>()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
456members.OfType<INamedTypeSymbol>().Select(n => n.ToCodeGenerationSymbol()).ToImmutableArray(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
101? this.GetMembers(WellKnownMemberNames.DelegateInvokeName).OfType<IMethodSymbol>().FirstOrDefault() 174this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)); 184this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
199foreach (var namedType in SymbolAnnotation.GetSymbols(annotation, model.Compilation).OfType<INamedTypeSymbol>())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (3)
79.OfType<IMethodSymbol>() 443from method in baseType.GetMembers(EqualsName).OfType<IMethodSymbol>() 506.OfType<IFieldSymbol>()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
205from method in baseType.GetMembers(GetHashCodeName).OfType<IMethodSymbol>()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AbstractAddImportsService.cs (1)
179fallbackNode = contextSpine.OfType<TNamespaceDeclarationSyntax>().FirstOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
165return (disposableType, disposableType?.GetMembers().OfType<IMethodSymbol>().FirstOrDefault(m => m.Parameters.Length == 0 && m.Name == methodName));
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SymbolKeyTests.cs (1)
840.Where(n => !n.IsImplicitlyDeclared).Single().GetMembers("M").OfType<IMethodSymbol>().Single().TypeParameters.Single();
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
649foreach (IFieldSymbol fs in currentClassType.GetMembers().OfType<IFieldSymbol>())
Microsoft.Extensions.Options.SourceGeneration (2)
ParserUtilities.cs (2)
81if (type.GetMembers(propertyName).OfType<IPropertySymbol>().Any(property => 95if (interfaceType.GetMembers(propertyName).OfType<IPropertySymbol>().Any(property =>
Microsoft.Gen.ComplianceReports (3)
Parser.cs (3)
142foreach (var property in typeSymbol.GetMembers().OfType<IPropertySymbol>()) 147foreach (var field in typeSymbol.GetMembers().OfType<IFieldSymbol>()) 204var methods = typeSymbol.GetMembers().OfType<IMethodSymbol>();
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
497var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.Gen.ContextualOptions (1)
Parser.cs (1)
78.OfType<IPropertySymbol>()
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
497var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
497var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
497var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
497var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.Interop.ComInterfaceGenerator (1)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
65foreach (var method in type.GetMembers().OfType<IMethodSymbol>().Where(m => !m.IsStatic && m.IsAbstract))
Microsoft.Interop.JavaScript.JSImportGenerator (2)
JSExportCodeGenerator.cs (1)
168.Concat(_marshallers.NativeParameterMarshallers.OfType<IJSMarshallingGenerator>().SelectMany(p => p.GenerateBind()));
JSImportCodeGenerator.cs (1)
160.Concat(_marshallers.NativeParameterMarshallers.OfType<IJSMarshallingGenerator>().SelectMany(p => p.GenerateBind()));
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (1)
985if (marshallerType.GetMembers(ShapeMemberNames.BufferSize).OfType<IPropertySymbol>().FirstOrDefault(prop => prop is { ReturnsByRef: false, ReturnsByRefReadonly: false, GetMethod: not null }) is null)
Microsoft.Interop.SourceGeneration (29)
MarshallerShape.cs (28)
208.OfType<IMethodSymbol>() 218.OfType<IMethodSymbol>() 261.OfType<IMethodSymbol>() 273.OfType<IMethodSymbol>() 292.OfType<IMethodSymbol>() 301.OfType<IMethodSymbol>() 313.OfType<IMethodSymbol>() 324.OfType<IMethodSymbol>() 345.OfType<IMethodSymbol>() 355.OfType<IMethodSymbol>() 365.OfType<IMethodSymbol>() 375.OfType<IMethodSymbol>() 385.OfType<IMethodSymbol>() 395.OfType<IMethodSymbol>() 564.OfType<IMethodSymbol>() 575.OfType<IMethodSymbol>() 593.OfType<IMethodSymbol>() 601.OfType<IMethodSymbol>() 609.OfType<IMethodSymbol>() 616.OfType<IMethodSymbol>() 655.OfType<IMethodSymbol>() 662.OfType<IMethodSymbol>() 669.OfType<IMethodSymbol>() 678.OfType<IMethodSymbol>() 689.OfType<IMethodSymbol>() 698.OfType<IMethodSymbol>() 707.OfType<IMethodSymbol>() 717.OfType<IMethodSymbol>()
TypeSymbolExtensions.cs (1)
156foreach (IFieldSymbol field in type.GetMembers().OfType<IFieldSymbol>())
Microsoft.VisualStudio.LanguageServices (1)
Venus\ContainedLanguageCodeSupport.cs (1)
109var methods = type.GetMembers().OfType<IMethodSymbol>().Where(m => m.CompatibleSignatureToDelegate((INamedTypeSymbol)eventType));
Mvc.Api.Analyzers.Test (1)
MvcFactsTest.cs (1)
185var method = typeSymbol.GetMembers(nameof(IDisposable.Dispose)).OfType<IMethodSymbol>().First(f => !f.ReturnsVoid);
System.Text.Json.SourceGeneration (2)
JsonSourceGenerator.Parser.cs (2)
928foreach (IPropertySymbol propertyInfo in members.OfType<IPropertySymbol>()) 949foreach (IFieldSymbol fieldInfo in members.OfType<IFieldSymbol>())
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationAnalyzer.cs (1)
63.OfType<IMethodSymbol>()
System.Windows.Forms.Analyzers.VisualBasic (1)
Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb (1)
65OfType(Of IMethodSymbol)().