6 implementations of ContainingType
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
CodeGenerationSymbol.cs (1)
32public INamedTypeSymbol ContainingType { get; protected set; }
Microsoft.CodeAnalysis.CSharp (2)
Symbols\PublicModel\PreprocessingSymbol.cs (1)
25INamedTypeSymbol? ISymbol.ContainingType => null;
Symbols\PublicModel\Symbol.cs (1)
71INamedTypeSymbol ISymbol.ContainingType
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
39public INamedTypeSymbol ContainingType => _symbol.ContainingType;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Symbol.vb (1)
1162Private ReadOnly Property ISymbol_ContainingType As INamedTypeSymbol Implements ISymbol.ContainingType
Microsoft.CodeAnalysis.Workspaces (1)
CodeGenerationSymbol.cs (1)
32public INamedTypeSymbol ContainingType { get; protected set; }
896 references to ContainingType
Microsoft.CodeAnalysis (19)
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1609await processContainerOnMemberCompletedAsync(symbol.ContainingType, symbol, analyzer).ConfigureAwait(false);
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (6)
526var typeParameter = GetNthTypeParameter(bindingContext.ContainingType, typeParameterIndex); 560for (var containingType = bindingContext.ContainingType; containingType != null; containingType = containingType.ContainingType) 838var containingTypeParameterCount = GetTypeParameterCount(typeSymbol.ContainingType); 841return GetNthTypeParameter(typeSymbol.ContainingType, n); 861return typeSymbol.TypeParameters.Length + GetTypeParameterCount(typeSymbol.ContainingType);
DocumentationCommentId.cs (4)
959var typeContext = methodContext != null ? methodContext.ContainingType : typeParameterContext as INamedTypeSymbol; 1370var containingTypeParameterCount = GetTypeParameterCount(typeSymbol.ContainingType); 1373return GetNthTypeParameter(typeSymbol.ContainingType, n); 1393return typeSymbol.TypeParameters.Length + GetTypeParameterCount(typeSymbol.ContainingType);
Emit\EditAndContinue\SymbolChanges.cs (2)
158currentSymbol = currentSymbol.ContainingType; 201current = current.ContainingType;
Operations\ControlFlowGraphBuilder.cs (5)
6905operation.Property.ContainingType.IsAnonymousType && 6906operation.Property.ContainingType == _currentImplicitInstance.AnonymousType) 6985operation.Syntax, fieldSymbol.ContainingType, isImplicit: true); 7003operation.Syntax, propertySymbol.ContainingType, isImplicit: true); 7532type: matchFailureCtor.ContainingType, constantValue: null, isImplicit: true);
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (1)
149var type = ctor.ContainingType;
Microsoft.CodeAnalysis.CodeStyle (92)
AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (3)
154&& symbol.ContainingType.GetAttributes().Any(static (x, dataContractAttribute) => SymbolEqualityComparer.Default.Equals(x.AttributeClass, dataContractAttribute), dataContractAttribute); 234if (!field.ContainingType.Equals(owningSymbol.ContainingType))
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
738methodSymbol.ContainingType.GetMembers(suffix).Any(static m => m is IPropertySymbol);
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
279if (method is { MetadataName: "GetInstance", IsStatic: true, Parameters.Length: 1, ContainingType: { } containingType } methodSymbol &&
AbstractSimplifyInterpolationHelpers.cs (5)
127return method.ContainingType.SpecialType == SpecialType.System_Object 144return IsType<CultureInfo>(member.ContainingType, operation.SemanticModel); 148return IsType<NumberFormatInfo>(member.ContainingType, operation.SemanticModel) 149|| IsType<DateTimeFormatInfo>(member.ContainingType, operation.SemanticModel); 166TargetMethod: { Name: nameof(FormattableString.Invariant), ContainingType: var containingType },
AbstractSpeculationAnalyzer.cs (10)
383var type = methodSymbol.ContainingType; 384var newType = newMethodSymbol.ContainingType; 707&& symbol.ContainingType.SpecialType == SpecialType.System_Object 845symbol.ContainingType != null && 846symbol.ContainingType.IsAnonymousType(); 901if (newSymbol.ContainingType.IsDelegateType() && 902symbol.ContainingType.IsDelegateType() && 903IsReferenceConversion(this.OriginalSemanticModel.Compilation, newSymbol.ContainingType, symbol.ContainingType)) 957var newSymbolContainingType = newSymbol.ContainingType;
AbstractUseAutoPropertyAnalyzer.cs (2)
158if (!containingType.Equals(property.ContainingType)) 212if (!containingType.Equals(getterField.ContainingType))
AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
297var containingType = symbolInfo.Symbol.ContainingType;
DeserializationConstructorCheck.cs (1)
30methodSymbol.ContainingType.AllInterfaces.Contains(_iSerializableType);
HashCodeAnalyzer.OperationDeconstructor.cs (4)
88Equals(_analyzer._equalityComparerType, targetMethod.ContainingType.OriginalDefinition) && 132Equals(_method.ContainingType.BaseType, instanceReference.Type)) 154Equals(fieldOrProp.ContainingType.OriginalDefinition, _method.ContainingType))
INamedTypeSymbolExtensions.cs (7)
44for (var current = symbol; current != null; current = current.ContainingType) 55for (var current = symbol; current != null; current = current.ContainingType) 86if (member.ContainingType.TypeKind == TypeKind.Interface) 157if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 262return implementation != null && Equals(implementation.ContainingType, classOrStructType); 281return implementation != null && Equals(implementation.ContainingType, classOrStructType); 615ContainingType.SpecialType: SpecialType.System_Object,
IParameterSymbolExtensions.cs (2)
32ContainingType: { IsRecord: true } containingType, 64ContainingType: { } containingType,
IPropertySymbolExtensions.cs (1)
12=> property.ContainingType.GetMembers()
ISymbolExtensions.cs (12)
98var containingType = symbol.ContainingType; 114return symbol?.ContainingType?.TypeKind == TypeKind.Class && 122symbol.ContainingType != null && 123symbol.ContainingType.TypeKind == TypeKind.Interface) 159return symbol.ContainingType; 208=> symbol?.Kind == SymbolKind.Field && symbol.ContainingType.IsEnumType(); 220=> symbol is { ContainingType.TypeKind: TypeKind.Module }; 256=> symbol is IPropertySymbol && symbol.ContainingType.IsNormalAnonymousType(); 259=> symbol is IFieldSymbol { ContainingType.IsTupleType: true }; 380symbol = symbol.ContainingType; 399var containingType = symbol.ContainingType; 403containingType = containingType.ContainingType;
ISymbolExtensions_Accessibility.cs (5)
171return IsMemberAccessible(symbol.ContainingType, symbol.DeclaredAccessibility, within, throughType, out failedThroughTypeCheck); 207var containingType = type.ContainingType; 210: IsMemberAccessible(type.ContainingType, type.DeclaredAccessibility, within, null, out _); 404current = current.ContainingType; 450current = current.ContainingType;
ITypeSymbolExtensions.cs (5)
138current = current.ContainingType; 144var current = type.ContainingType; 148current = current.ContainingType; 232b.ContainingType == null && 248&& symbol.ContainingType == null
ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (2)
57if (symbol.ContainingType != null) 59accessibility = AccessibilityUtilities.Minimum(accessibility, symbol.ContainingType.Accept(this));
NamingStyleRules.cs (2)
73var containingType = symbol.ContainingType; 95var containingType = symbol.ContainingType;
SuppressMessageAttributeState.cs (1)
69_suppressMessageAttributeType.Equals(propertyReference.Property.ContainingType))
SuppressMessageAttributeState.TargetSymbolResolver.cs (6)
526var typeParameter = GetNthTypeParameter(bindingContext.ContainingType, typeParameterIndex); 560for (var containingType = bindingContext.ContainingType; containingType != null; containingType = containingType.ContainingType) 838var containingTypeParameterCount = GetTypeParameterCount(typeSymbol.ContainingType); 841return GetNthTypeParameter(typeSymbol.ContainingType, n); 861return typeSymbol.TypeParameters.Length + GetTypeParameterCount(typeSymbol.ContainingType);
SymbolEquivalenceComparer.cs (2)
185x.ContainingType != null && 186x.ContainingType.IsAnonymousType)
SymbolEquivalenceComparer.EquivalenceVisitor.cs (6)
384x.ContainingType == null && 573if (x.ContainingType.IsAnonymousType && y.ContainingType.IsAnonymousType) 604(x.TypeParameterKind == TypeParameterKind.Type && IsConstructedFromSelf(x.ContainingType)) || 608(y.TypeParameterKind == TypeParameterKind.Type && IsConstructedFromSelf(y.ContainingType)) || 625if (x.TypeParameterKind == TypeParameterKind.Type && x.ContainingType.IsAnonymousType)
SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
264(x.TypeParameterKind == TypeParameterKind.Type && IsConstructedFromSelf(x.ContainingType)) || 276if (x.TypeParameterKind == TypeParameterKind.Type && x.ContainingType.IsAnonymousType)
SymbolKey.cs (3)
30/// the "same" <see cref="ISymbol.ContainingType"/> and 33/// the "same" <see cref="ISymbol.ContainingType"/>, 59/// the "same" the "same" <see cref="ISymbol.ContainingType"/>,
SymbolKey.ErrorTypeSymbolKey.cs (1)
116return reader.ReadSymbolKey(contextualType?.ContainingType, out failureReason);
SymbolKey.EventSymbolKey.cs (2)
16visitor.WriteSymbolKey(symbol.ContainingType); 23var containingTypeResolution = reader.ReadSymbolKey(contextualSymbol?.ContainingType, out var containingTypeFailureReason);
SymbolKey.FieldSymbolKey.cs (2)
16visitor.WriteSymbolKey(symbol.ContainingType); 23var containingTypeResolution = reader.ReadSymbolKey(contextualSymbol?.ContainingType, out var containingTypeFailureReason);
UseExplicitTupleNameDiagnosticAnalyzer.cs (2)
51if (field.ContainingType.IsTupleType) 55var namedField = GetNamedField(field.ContainingType, field, context.CancellationToken);
UseNamedMemberInitializerAnalyzer.cs (1)
190if (member != null && member.ContainingType.IsInterfaceType())
Microsoft.CodeAnalysis.CodeStyle.Fixes (10)
AbstractAddParameterCodeFixProvider.cs (2)
156IMethodSymbol methodSymbol => methodSymbol.ContainingType, // Implicit object creation expressions 377invocationDocument, argument, method.ContainingType, cancellationToken).ConfigureAwait(false);
AbstractCodeGenerationService.cs (1)
377return field != null && field.ContainingType.IsEnumType();
AbstractFlagsEnumGenerator.cs (1)
46var type = ctor.ContainingType;
AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
127symbol.ContainingType?.SpecialType == SpecialType.System_Enum;
CodeGenerationConstructorInfo.cs (1)
84=> info == null ? constructor.ContainingType.Name : info._typeName;
CodeGenerationDestructorInfo.cs (1)
53=> info == null ? constructor.ContainingType.Name : info._typeName;
INamedTypeSymbolExtensions.cs (1)
20namedType.ContainingType,
SyntaxGeneratorExtensions_Negate.cs (1)
420var containingType = property.ContainingType;
UseSystemHashCodeCodeFixProvider.cs (1)
78var containingType = accessesBase ? method!.ContainingType : null;
Microsoft.CodeAnalysis.CSharp (29)
SymbolDisplay\SymbolDisplayVisitor.cs (3)
310INamedTypeSymbol containingType = symbol.ContainingType; 408&& symbol.ContainingType != null 409&& symbol.ContainingType.TypeKind == TypeKind.Enum
SymbolDisplay\SymbolDisplayVisitor.Members.cs (22)
57IncludeNamedType(symbol.ContainingType)) 59symbol.ContainingType.Accept(this.NotFirstVisitor); 63if (symbol.ContainingType.TypeKind == TypeKind.Enum) 92if (property.ContainingType?.IsReadOnly == true) 116if (method.ContainingType?.IsReadOnly == true) 165IncludeNamedType(symbol.ContainingType)) 167symbol.ContainingType.Accept(this.NotFirstVisitor); 247IncludeNamedType(symbol.ContainingType)) 249symbol.ContainingType.Accept(this.NotFirstVisitor); 313if ((object)symbol.ContainingType != null || (symbol.ContainingSymbol is ITypeSymbol)) 401containingType = symbol.ContainingType; 405includeType = IncludeNamedType(symbol.ContainingType); 475var name = format.CompilerInternalOptions.IncludesOption(SymbolDisplayCompilerInternalOptions.UseMetadataMethodNames) || symbol.ContainingType == null || symbol.ContainingType.IsAnonymousType 477: symbol.ContainingType.Name; 489if (format.CompilerInternalOptions.IncludesOption(SymbolDisplayCompilerInternalOptions.UseMetadataMethodNames) || symbol.ContainingType == null) 496builder.Add(CreatePart(partKind, symbol, symbol.ContainingType.Name)); 757if (symbol.ContainingType is null) 762return GetPartKind(symbol.ContainingType); 925INamedTypeSymbol containingType = symbol.ContainingType; 1053Debug.Assert(implementedMember.ContainingType != null); 1055INamedTypeSymbol containingType = implementedMember.ContainingType;
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
287if (IncludeNamedType(symbol.ContainingType)) 289symbol.ContainingType.Accept(this.NotFirstVisitor);
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (2)
131if (IncludeNamedType(symbol.ContainingType)) 133symbol.ContainingType.Accept(this.NotFirstVisitor);
Microsoft.CodeAnalysis.CSharp.CodeStyle (18)
CastSimplifier.cs (3)
579if (current.ContainingType.SpecialType == SpecialType.System_Object) 1097if (originalMemberSymbol.ContainingType.TypeKind == TypeKind.Interface) 1145var rewrittenContainingType = rewrittenMemberSymbol.ContainingType;
ConvertProgramAnalysis_TopLevelStatements.cs (2)
87canConvertToTopLevelStatements = TypeCanBeConverted(entryPointMethod.ContainingType, containingTypeDeclaration); 105if (containingType.ContainingType != null)
CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
253if (methodReference.ContainingType.SpecialType is SpecialType.System_Object or SpecialType.System_ValueType)
CSharpUseAutoPropertyAnalyzer.cs (1)
111if (symbolInfo.GetAnySymbol() is not IFieldSymbol { ContainingType.TypeKind: TypeKind.Struct })
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
197if (symbol is null || !symbol.IsUserDefinedOperator() || symbol.ContainingType.SpecialType == SpecialType.System_String) 215symbol.ContainingType?.SpecialType == SpecialType.System_Object)
CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (1)
74var containingType = method.ContainingType;
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
359var delegateContainingType = delegateType.ContainingType; 383localEnclosingSymbol = localEnclosingSymbol.ContainingType;
CSharpUseRangeOperatorDiagnosticAnalyzer.cs (2)
242var indexer = GetIndexer(targetMethod.ContainingType, infoCache.RangeType, targetMethod.ContainingType);
CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (3)
101var overloadWithTwoArguments = method.ContainingType 128var containingType = sliceLikeMethod.ContainingType; 157sliceLikeMethod.ContainingType.GetMembers(nameof(Span<int>.Slice))
Helpers.cs (1)
145: method.ContainingType.GetMembers(method.Name)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (21)
ConvertToRecordHelpers.cs (4)
32var type = methodSymbol.ContainingType; 312var positionalParam = param.ContainingSymbol.ContainingType.GetMembers().FirstOrDefault(member 495var type = methodSymbol.ContainingType; 1102equals.Equals(equals.ContainingType.FindImplementationForInterfaceMember(equatableEquals)))
CSharpAddParameterCodeFixProvider.cs (1)
66var type = constructorSymbol.ContainingType;
CSharpCodeGenerationHelpers.cs (1)
215if (implementation.ContainingType.GenerateTypeSyntax() is not NameSyntax name)
CSharpCodeGenerationService.cs (2)
79if (newDestinationSymbol?.ContainingType != null) 81return await AddNamedTypeAsync(newContext, newDestinationSymbol.ContainingType, namedType, cancellationToken).ConfigureAwait(false);
CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
128var memberContainer = matchingMember.ContainingType.ToMinimalDisplayString(semanticModel, span.Start);
CSharpMakeMemberRequiredCodeFixProvider.cs (2)
70var containingTypeVisibility = propertySymbol.ContainingType.GetResultantVisibility(); 80var containingTypeVisibility = fieldSymbol.ContainingType.GetResultantVisibility();
EventGenerator.cs (1)
227if (@event.AddMethod?.IsReadOnly == true && !@event.ContainingType.IsReadOnly)
FieldGenerator.cs (1)
113var canUseFieldReference = field.Type != null && !field.Type.Equals(field.ContainingType);
ITypeSymbolExtensions.cs (1)
106containingType = containingType.ContainingType;
ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (3)
48if (symbol.ContainingType != null) 50if (symbol.ContainingType.TypeKind == TypeKind.Submission) 56var container = symbol.ContainingType.Accept(this)!;
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (3)
268if (symbol.ContainingType != null) 270if (symbol.ContainingType.TypeKind != TypeKind.Submission) 272var containingTypeSyntax = symbol.ContainingType.Accept(this);
PropertyGenerator.cs (1)
378if (hasAllReadOnlyAccessors && !property.ContainingType.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
DecompiledSource\CSharpDecompiledSourceService.cs (2)
165symbol = (INamespaceOrTypeSymbol?)symbol.ContainingType ?? symbol.ContainingNamespace) 167if (symbol.ContainingType is not null)
EventHookup\EventHookupSessionManager_EventHookupSession.cs (1)
290: eventSymbol.ContainingType.Name;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (15)
EditAndContinue\TopLevelEditingTests.cs (15)
2939SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3056SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3091SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3178SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3199SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3234SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3255SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3277SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3299SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3389SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3413SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3487SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3511SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3602SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))), 3643SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("Equals").OfType<IMethodSymbol>().First(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType))),
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (17)
CodeGen\CodeGenLocalFunctionTests.cs (15)
2595Assert.Equal(verify.Compilation.GetTypeByMetadataName("Program"), goo.ContainingType); 2613Assert.Equal(program, goo.ContainingType); 2719Assert.Equal(outer.ContainingType, inner.ContainingType); 3134Assert.Equal(program, goo.ContainingType); 3205Assert.Equal(program, inner.ContainingType); 3206Assert.Equal(program, middle.ContainingType); 3207Assert.Equal(program, outer.ContainingType); 3251Assert.Equal(program, verify.FindLocalFunction("First").ContainingType); 3252Assert.Equal(program, verify.FindLocalFunction("Second").ContainingType); 3277Assert.Equal(program, goo.ContainingType); 3312Assert.Equal(program, goo.ContainingType); 3313Assert.Equal(program, bar.ContainingType); 3398Assert.Equal(program, verify.FindLocalFunction("Inner").ContainingType); 4241Assert.Equal(verify.Compilation.GetTypeByMetadataName("Program"), goo.ContainingType);
CodeGen\IndexAndRangeTests.cs (2)
42Assert.Equal(containingTypeName, symbol.ContainingType.Name); 1003Assert.Equal("S", property.ContainingType.Name);
Microsoft.CodeAnalysis.CSharp.Features (61)
ChangeSignature\CSharpChangeSignatureService.cs (1)
867if (Equals(convertedType, symbol.ContainingType))
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (2)
127containingType: declaredSymbol.ContainingType, 326reservedNames: declaredSymbol.ContainingType.GetMembers().Select(m => m.Name));
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
465ContainingType: not { SpecialType: SpecialType.System_Nullable_T }
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
300containingType.Equals(symbol.ContainingType))
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (1)
68var symbols = ImmutableArray.Create<ISymbol>(conversion.ContainingType, conversion.Parameters.First().Type, conversion.ReturnType);
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (2)
45return NameGenerator.GenerateUniqueName(fieldName, n => !(property.ContainingType.Name == n || property.ContainingType.GetMembers(n).Any()));
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (1)
249TypeSymbolIsList(methodSymbol.ContainingType, semanticModel) &&
ConvertProgramAnalysis_TopLevelStatements.cs (2)
87canConvertToTopLevelStatements = TypeCanBeConverted(entryPointMethod.ContainingType, containingTypeDeclaration); 105if (containingType.ContainingType != null)
ConvertToRecordHelpers.cs (4)
32var type = methodSymbol.ContainingType; 312var positionalParam = param.ContainingSymbol.ContainingType.GetMembers().FirstOrDefault(member 495var type = methodSymbol.ContainingType; 1102equals.Equals(equals.ContainingType.FindImplementationForInterfaceMember(equatableEquals)))
CSharpAddParameterCodeFixProvider.cs (1)
66var type = constructorSymbol.ContainingType;
CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
128var memberContainer = matchingMember.ContainingType.ToMinimalDisplayString(semanticModel, span.Start);
CSharpMakeMemberRequiredCodeFixProvider.cs (2)
70var containingTypeVisibility = propertySymbol.ContainingType.GetResultantVisibility(); 80var containingTypeVisibility = fieldSymbol.ContainingType.GetResultantVisibility();
CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
253if (methodReference.ContainingType.SpecialType is SpecialType.System_Object or SpecialType.System_ValueType)
CSharpUseAutoPropertyAnalyzer.cs (1)
111if (symbolInfo.GetAnySymbol() is not IFieldSymbol { ContainingType.TypeKind: TypeKind.Struct })
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
197if (symbol is null || !symbol.IsUserDefinedOperator() || symbol.ContainingType.SpecialType == SpecialType.System_String) 215symbol.ContainingType?.SpecialType == SpecialType.System_Object)
CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (1)
74var containingType = method.ContainingType;
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
359var delegateContainingType = delegateType.ContainingType; 383localEnclosingSymbol = localEnclosingSymbol.ContainingType;
CSharpUseRangeOperatorDiagnosticAnalyzer.cs (2)
242var indexer = GetIndexer(targetMethod.ContainingType, infoCache.RangeType, targetMethod.ContainingType);
CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (3)
101var overloadWithTwoArguments = method.ContainingType 128var containingType = sliceLikeMethod.ContainingType; 157sliceLikeMethod.ContainingType.GetMembers(nameof(Span<int>.Slice))
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
2491{ ContainingType.Arity: > 0 } and not INamedTypeSymbol 2515{ ContainingType.TypeKind: TypeKind.Interface } and not INamedTypeSymbol 2520IFieldSymbol { ContainingType.TypeKind: TypeKind.Enum }
EncapsulateField\CSharpEncapsulateFieldService.cs (5)
114field.ContainingType, 166return (field.Name, MakeUnique(GeneratePropertyName(field.Name), field.ContainingType)); 176return (MakeUnique(GenerateFieldName(field.Name), field.ContainingType), newPropertyName); 180newPropertyName = MakeUnique(newPropertyName, field.ContainingType); 190return (MakeUnique(newFieldName, field.ContainingType), newPropertyName);
GenerateConstructorFromMembers\CSharpGenerateConstructorFromMembersCodeRefactoringProvider.cs (2)
62var containingType = property.ContainingType; 76return property.ContainingType.GetMembers(accessedMemberName).FirstOrDefault() as IFieldSymbol;
GenerateType\CSharpGenerateTypeService.cs (1)
67symbol = symbol.ContainingType;
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (4)
81var containingType = member.ContainingType; 83s => s.ContainingType).Distinct().ToImmutableArray(); 196containingType.Equals(impl.ContainingType) && 222interfaceMembers.First().ContainingType,
ImplementInterface\CSharpImplementImplicitlyCodeRefactoringProvider.cs (2)
42var containingTypeInterfaces = member.ContainingType.AllInterfaces; 45return memberInterfaceImplementations.Any(static (impl, containingTypeInterfaces) => containingTypeInterfaces.Contains(impl.ContainingType), containingTypeInterfaces);
InitializeParameter\CSharpInitializeMemberFromParameterCodeRefactoringProvider.cs (1)
158IsFieldOrPropertyReference(tupleLeft.Elements[i], sibling.ContainingType, out _))
J\s\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs\Helpers.cs (1)
145: method.ContainingType.GetMembers(method.Name)
NavigationBar\CSharpNavigationBarItemService.cs (1)
208return symbol.ContainingType.TypeKind == TypeKind.Enum
SignatureHelp\AttributeSignatureHelpProvider.cs (2)
137var namedParameters = constructor.ContainingType.GetAttributeNamedParameters(semanticModel.Compilation, within) 221result.AddRange(method.ContainingType.ToMinimalDisplayParts(semanticModel, position));
SignatureHelp\ConstructorInitializerSignatureHelpProvider.cs (1)
168result.AddRange(method.ContainingType.ToMinimalDisplayParts(semanticModel, position));
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (1)
265result.AddRange(indexer.ContainingType.ToMinimalDisplayParts(semanticModel, position));
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_DelegateAndFunctionPointerInvoke.cs (2)
32!expressionSymbol.ContainingType.OriginalDefinition.Equals(within.OriginalDefinition)) 72displayParts.AddRange(invokeMethod.ContainingType.ToMinimalDisplayParts(semanticModel, position));
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
62(throughSymbol is not INamespaceOrTypeSymbol && semanticModel.LookupSymbols(throughExpression.SpanStart, container: throughSymbol?.ContainingType).Any(static s => s is not INamedTypeSymbol));
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider_DelegateType.cs (1)
41result.AddRange(invokeMethod.ContainingType.ToMinimalDisplayParts(semanticModel, position));
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider_NormalType.cs (1)
47result.AddRange(method.ContainingType.ToMinimalDisplayParts(semanticModel, position));
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProvider.cs (1)
146result.AddRange(method.ContainingType.ToMinimalDisplayParts(semanticModel, position));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (14)
Semantics\InteractiveUsingTests.cs (3)
193Assert.Equal(((Compilation)sub3).ScriptClass, GetSpeculativeType(sub3, "A").ContainingType); 215Assert.Equal(sub.ScriptClass.GetMember("Type"), GetSpeculativeSymbol(sub, "Field").ContainingType); 234Assert.Equal(typeSymbol, GetSpeculativeSymbol(sub4, "CC").ContainingType);
Semantics\LambdaTests.cs (1)
3931var expectedAttributeType = expectedAttributeConstructor.ContainingType;
Semantics\LocalFunctionTests.cs (1)
1064Assert.Equal("A", attrConstructor.ContainingType.Name);
Semantics\NativeIntegerTests.cs (1)
539Assert.Same(type, member.ContainingType);
Semantics\OperatorTests.cs (8)
7629expectChecked = (type.IsDynamic() || symbol1.ContainingType.EnumUnderlyingTypeOrSelf().SpecialType.IsIntegralType()); 7637symbol1.ContainingType.EnumUnderlyingTypeOrSelf().SpecialType.IsIntegralType() || 7638symbol1.ContainingType.SpecialType == SpecialType.System_Char); 8407isChecked = isDynamic || symbol1.ContainingSymbol.Kind == SymbolKind.PointerType || symbol1.ContainingType.EnumUnderlyingTypeOrSelf().SpecialType.IsIntegralType(); 8643Assert.Null(symbol1.ContainingType); 8654Assert.Null(symbol2.ContainingType); 8693Assert.Null(symbol1.ContainingType); 8704Assert.Null(symbol2.ContainingType);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (52)
Compilation\SemanticModelAPITests.cs (3)
1368Assert.Equal(comp.GlobalNamespace.GetMember<INamedTypeSymbol>("C"), symbol.ContainingType); 2084Assert.Equal(comp.GlobalNamespace.GetMember<INamedTypeSymbol>("C"), symbol.ContainingType); 2101Assert.Equal(comp.GlobalNamespace.GetMember<INamedTypeSymbol>("C"), symbol.ContainingType);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (8)
1387Assert.Equal(9, symbolsInC.Where(s => s.ContainingType == null || s.ContainingType.SpecialType != SpecialType.System_Object).Count()); 1391Assert.True(symbolsInC.Any(s => s.Name == "M" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "A")); 1392Assert.True(symbolsInC.Any(s => s.Name == "M" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "B")); 1393Assert.True(symbolsInC.Any(s => s.Name == "M" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "C")); 1394Assert.True(symbolsInC.Any(s => s.Name == "F" && s.Kind == SymbolKind.Method && s.ContainingType.Name == "C")); 3645Assert.Equal(enumTypeSymbol, symbol.ContainingType); 3649Assert.Equal(enumTypeSymbol, fSymbol.ContainingType);
Compilation\SemanticModelGetSemanticInfoTests.cs (1)
9280var a = type.ContainingType;
DocumentationComments\CrefTests.cs (1)
5720Assert.Equal(SpecialType.System_Decimal, symbol.ContainingType.SpecialType);
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (2)
1038Assert.Equal(classDisposable, methodDispose.ContainingType); 1052var type = methodSymbol.ContainingType;
Symbols\ConversionTests.cs (2)
1803Assert.Equal(comp.GlobalNamespace.GetMember<INamedTypeSymbol>("C"), method.ContainingType); 1837Assert.Equal(comp.GlobalNamespace.GetMember<INamedTypeSymbol>("C"), method.ContainingType);
Symbols\Source\NullablePublicAPITests.cs (20)
2743Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2744Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2748Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2749Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2789Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2790Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2794Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2795Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2832Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2833Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2837Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2838Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2881Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2882Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2886Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2887Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 3414Assert.Equal(annotation, method.ContainingType.TypeArgumentNullableAnnotations[0]); 3415Assert.Equal(annotation, method.ContainingType.TypeArgumentNullableAnnotations().First()); 3459Assert.Equal(annotation, method.ContainingType.TypeArgumentNullableAnnotations[0]); 3460Assert.Equal(annotation, method.ContainingType.TypeArgumentNullableAnnotations().First());
Symbols\StaticAbstractMembersInInterfacesTests.cs (5)
19591Assert.DoesNotContain(opName, declaredSymbol.ContainingType.MemberNames); 19674Assert.DoesNotContain(opName, declaredSymbol.ContainingType.MemberNames); 19766Assert.DoesNotContain(opName, declaredSymbol.ContainingType.MemberNames); 19855Assert.DoesNotContain(opName, declaredSymbol.ContainingType.MemberNames); 28804Assert.DoesNotContain(opName, declaredSymbol.ContainingType.MemberNames);
Symbols\SymbolEqualityTests.cs (8)
170var nonNullSubstituted = nonNullM.ContainingType.GetMembers("M").Single(); 171var nullSubstituted = nullM.ContainingType.GetMembers("M").Single(); 795var field1ContainingType = field1.ContainingType; //A<T> 796var field2ContainingType = field2.ContainingType; //A<T!> 853var method1ContainingType = method1.ContainingType; //A<T> 854var method2ContainingType = method2.ContainingType; //A<T!> 907var event1ContainingType = event1.ContainingType; //A<T> 908var event2ContainingType = event2.ContainingType; //A<T!>
Symbols\TypeTests.cs (2)
1858Assert.False(symbol.ContainingType.IsUnboundGenericType); 1859Assert.IsType<UnboundArgumentErrorTypeSymbol>(symbol.ContainingType.TypeArguments.Single().GetSymbol());
Microsoft.CodeAnalysis.CSharp.Workspaces (42)
CastSimplifier.cs (3)
579if (current.ContainingType.SpecialType == SpecialType.System_Object) 1097if (originalMemberSymbol.ContainingType.TypeKind == TypeKind.Interface) 1145var rewrittenContainingType = rewrittenMemberSymbol.ContainingType;
Classification\SyntaxClassification\NameSyntaxClassifier.cs (2)
270return fieldSymbol.ContainingType.IsEnumType() ? ClassificationTypeNames.EnumMemberName : ClassificationTypeNames.ConstantName; 290return methodSymbol.ContainingType?.GetClassification() ?? ClassificationTypeNames.MethodName;
CodeGeneration\CSharpSyntaxGenerator.cs (2)
349=> SyntaxFactory.DestructorDeclaration(destructorMethod.ContainingType.Name).WithBody(SyntaxFactory.Block()); 1821=> SyntaxFactory.ExplicitInterfaceSpecifier(explicitInterfaceImplementations[0].ContainingType.GenerateNameSyntax());
CSharpCodeGenerationHelpers.cs (1)
215if (implementation.ContainingType.GenerateTypeSyntax() is not NameSyntax name)
CSharpCodeGenerationService.cs (2)
79if (newDestinationSymbol?.ContainingType != null) 81return await AddNamedTypeAsync(newContext, newDestinationSymbol.ContainingType, namedType, cancellationToken).ConfigureAwait(false);
EventGenerator.cs (1)
227if (@event.AddMethod?.IsReadOnly == true && !@event.ContainingType.IsReadOnly)
FieldGenerator.cs (1)
113var canUseFieldReference = field.Type != null && !field.Type.Equals(field.ContainingType);
ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (3)
48if (symbol.ContainingType != null) 50if (symbol.ContainingType.TypeKind == TypeKind.Submission) 56var container = symbol.ContainingType.Accept(this)!;
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (3)
268if (symbol.ContainingType != null) 270if (symbol.ContainingType.TypeKind != TypeKind.Submission) 272var containingTypeSyntax = symbol.ContainingType.Accept(this);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (1)
106containingType = containingType.ContainingType;
PropertyGenerator.cs (1)
378if (hasAllReadOnlyAccessors && !property.ContainingType.IsReadOnly)
Recommendations\CSharpRecommendationServiceRunner.cs (3)
300Equals(contextEnclosingNamedType, symbol.ContainingType) || 301contextOuterTypes.Any(outerType => outerType.Equals(symbol.ContainingType))); 526namedSymbols = namedSymbols.RemoveAll(s => s.ContainingType.SpecialType is SpecialType.System_Object or SpecialType.System_ValueType);
Recommendations\CSharpRecommendationServiceRunner_Conversions.cs (1)
186method.ContainingType,
Rename\CSharpRenameRewriterLanguageService.cs (4)
917if (renamedSymbol.ContainingType != null && renamedSymbol.ContainingType.GetMembers(renamedSymbol.Name).Contains(renamedSymbol)) 919var conflictingLocations = renamedSymbol.ContainingType.TypeParameters 1044var baseType = renamedSymbol.ContainingType?.GetBaseTypes().FirstOrDefault();
Simplification\CSharpSimplificationService.Expander.cs (10)
587if (symbol.IsConstructor() && symbol.ContainingType?.IsAttribute() == true) 589symbol = symbol.ContainingType; 643symbol = symbol.ContainingType; 689if (!Equals(_semanticModel.GetEnclosingNamedType(originalSimpleName.SpanStart, _cancellationToken), symbol.ContainingType)) 909if (replaceNode || symbol.ContainingType != null || symbol.ContainingNamespace != null) 915if (!replaceNode && symbol.ContainingType == null && symbol.ContainingNamespace.IsGlobalNamespace) 926: (symbol.ContainingType ?? (ISymbol)symbol.ContainingNamespace).ToDisplayParts(s_typeNameFormatWithGenerics); 1035type = type.ContainingType; 1097var containingTypeString = reducedExtensionMethod.ContainingType.ToDisplayString(s_typeNameFormatWithGenerics); 1103if (newContainingType == null || !newContainingType.Equals(reducedExtensionMethod.ContainingType))
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (1)
99symbol = symbol.ContainingType;
Simplification\Simplifiers\ExpressionSimplifier.cs (1)
424var containingType = rightSymbol.ContainingType;
Simplification\Simplifiers\NameSimplifier.cs (2)
82symbol = method.ContainingType; 705symbol = symbol.ContainingType;
Microsoft.CodeAnalysis.EditorFeatures (3)
GoToDefinition\AbstractGoToDefinitionService.cs (1)
158: symbolToNavigateTo.ContainingType;
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (2)
197if (renameSymbolInfo.Symbols.Single().ContainingType?.IsTupleType() == true) 232((IFieldSymbol)sourceSymbol).ContainingType.IsTupleType &&
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (5)
NavigationCommandHandlers\FindDerivedSymbolsCommandHandler.cs (2)
64if (symbol.ContainingType is INamedTypeSymbol namedTypeSymbol && symbol.ContainingType.TypeKind == TypeKind.Interface)
NavigationCommandHandlers\FindMemberOverloadsCommandHandler.cs (2)
80if (symbol == null || symbol.ContainingType == null) 83foreach (var curSymbol in symbol.ContainingType.GetMembers()
NavigationCommandHandlers\FindReferencesOfOverloadsCommandHandler.cs (1)
113foreach (var curSymbol in symbol.ContainingType.GetMembers()
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
PullMemberUp\TestPullMemberUpService.cs (1)
31var containingType = selectedNodeSymbols[0].ContainingType;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
SymbolFinder\DependentTypeFinderTests.cs (1)
764Assert.Equal(interfaceSymbol, interfaceMember.ContainingType);
SymbolFinder\FindSymbolAtPositionTests.cs (1)
63Assert.Equal(TypeKind.Enum, fieldSymbol.ContainingType.TypeKind);
Microsoft.CodeAnalysis.Features (176)
AbstractAddParameterCodeFixProvider.cs (2)
156IMethodSymbol methodSymbol => methodSymbol.ContainingType, // Implicit object creation expressions 377invocationDocument, argument, method.ContainingType, cancellationToken).ConfigureAwait(false);
AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (3)
154&& symbol.ContainingType.GetAttributes().Any(static (x, dataContractAttribute) => SymbolEqualityComparer.Default.Equals(x.AttributeClass, dataContractAttribute), dataContractAttribute); 234if (!field.ContainingType.Equals(owningSymbol.ContainingType))
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
738methodSymbol.ContainingType.GetMembers(suffix).Any(static m => m is IPropertySymbol);
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
279if (method is { MetadataName: "GetInstance", IsStatic: true, Parameters.Length: 1, ContainingType: { } containingType } methodSymbol &&
AbstractSimplifyInterpolationHelpers.cs (5)
127return method.ContainingType.SpecialType == SpecialType.System_Object 144return IsType<CultureInfo>(member.ContainingType, operation.SemanticModel); 148return IsType<NumberFormatInfo>(member.ContainingType, operation.SemanticModel) 149|| IsType<DateTimeFormatInfo>(member.ContainingType, operation.SemanticModel); 166TargetMethod: { Name: nameof(FormattableString.Invariant), ContainingType: var containingType },
AbstractUseAutoPropertyAnalyzer.cs (2)
158if (!containingType.Equals(property.ContainingType)) 212if (!containingType.Equals(getterField.ContainingType))
AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
297var containingType = symbolInfo.Symbol.ContainingType;
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (1)
49ContainingType = selectedMembers[0].ContainingType;
AddImport\SymbolReferenceFinder.cs (2)
228var typesContainedDirectlyInTypes = accessibleTypeSymbols.WhereAsArray(s => s.Symbol.ContainingType != null); 234r => searchScope.CreateReference(r.WithSymbol(r.Symbol.ContainingType)));
ChangeSignature\AbstractChangeSignatureService.cs (4)
116var containingType = method.ContainingType; 315symbolWithSyntacticParameters = methodSymbol.ContainingType; 319methodSymbol.ContainingType != null && 320methodSymbol.ContainingType.IsDelegateType())
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (2)
43var beginInvoke = symbol.ContainingType.GetMembers(WellKnownMemberNames.DelegateBeginInvokeName).FirstOrDefault(); 99if (convertedType == methodSymbol.ContainingType)
Completion\Providers\AbstractContextVariableArgumentProvider.cs (1)
97if (enclosingSymbol is IMethodSymbol { ContainingType: { } containingType })
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
102|| symbol.ContainingType.IsAnonymousType
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
65if (symbol.ContainingType?.SpecialType == SpecialType.System_Object)
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (2)
59var fields = propertySymbol.ContainingType.GetMembers().OfType<IFieldSymbol>(); 110var typeDeclaration = propertySymbol.ContainingType.DeclaringSyntaxReferences;
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
251method.ContainingType?.SpecialType == SpecialType.System_String &&
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
103var shouldReplaceInvocation = invocationSymbol is { ContainingType.SpecialType: SpecialType.System_String, Name: nameof(string.Format) };
Debugging\AbstractBreakpointResolver.cs (1)
189container = ((INamespaceOrTypeSymbol)container.ContainingType) ?? container.ContainingNamespace;
DeserializationConstructorCheck.cs (1)
30methodSymbol.ContainingType.AllInterfaces.Contains(_iSerializableType);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (36)
356=> symbol.IsConst ? ((symbol.ContainingType.TypeKind == TypeKind.Enum) ? FeaturesResources.enum_value : FeaturesResources.const_field) : 2478if (TypesEquivalent(oldSymbol.ContainingType, newSymbol.ContainingType, exact: false) && 2527var oldContainingType = oldSymbol?.ContainingType; 2528var newContainingType = newSymbol?.ContainingType; 2658if (IsPropertyAccessorDeclarationMatchingPrimaryConstructorParameter(oldDeclaration, newSymbol.ContainingType, out var isFirst)) 2661DeferConstructorEdit(oldSymbol.ContainingType, newSymbol.ContainingType, newDeclaration: null, syntaxMap, oldSymbol.IsStatic, ref instanceConstructorEdits, ref staticConstructorEdits); 2674AddEditsForSynthesizedRecordMembers(newCompilation, newSymbol.ContainingType, semanticEdits, cancellationToken); 2684DeferConstructorEdit(oldSymbol.ContainingType, newSymbol.ContainingType, newDeclaration: null, syntaxMap, oldSymbol.IsStatic, ref instanceConstructorEdits, ref staticConstructorEdits); 2733else if (oldSymbol.ContainingType != null) 2737var containingSymbolKey = SymbolKey.Create(oldSymbol.ContainingType, cancellationToken); 2788var newContainingType = newSymbol.ContainingType; 2795oldContainingType = oldSymbol.ContainingType; 2889DeferConstructorEdit(oldSymbol.ContainingType, newContainingType, newDeclaration, syntaxMap, newSymbol.IsStatic, ref instanceConstructorEdits, ref staticConstructorEdits); 3100DeferConstructorEdit(oldSymbol.ContainingType, newSymbol.ContainingType, newDeclaration, syntaxMap, newSymbol.IsStatic, ref instanceConstructorEdits, ref staticConstructorEdits); 3180var containingSymbolKey = SymbolKey.Create(oldSymbol.ContainingType, cancellationToken); 3223var oldContainingType = oldSymbol.ContainingType; 3224var newContainingType = newSymbol.ContainingType; 3380if (containingSymbol.ContainingType.IsDelegateType()) 3418var containingSymbolKey = SymbolKey.Create(oldSymbol.ContainingType, cancellationToken); 3447if (symbol.ContainingType is not { TypeKind: TypeKind.Class or TypeKind.Struct }) 3817TypesEquivalent(oldField.ContainingType.EnumUnderlyingType, newField.ContainingType.EnumUnderlyingType, exact: false)) 4043else if (newParameter.ContainingType.IsDelegateType()) 4093else if (oldMethod.ContainingType.IsDelegateType()) 4123else if (oldEvent.ContainingType.IsDelegateType()) 4153else if (oldProperty.ContainingType.IsDelegateType()) 4558SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, m.ContainingType)); 4682if (HasExplicitOrSequentialLayout(newSymbol.ContainingType, newModel, ref lazyLayoutAttribute)) 4691HasExplicitOrSequentialLayout(newSymbol.ContainingType, newModel, ref lazyLayoutAttribute)) 4700HasExplicitOrSequentialLayout(newSymbol.ContainingType, newModel, ref lazyLayoutAttribute)) 4711var intoStruct = symbol.ContainingType.TypeKind == TypeKind.Struct; 5011oldCtor = oldType.InstanceConstructors.Single(c => c.Parameters.Length == 1 && SymbolEqualityComparer.Default.Equals(c.Parameters[0].Type, c.ContainingType));
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
180IsDateTimeType(method.ContainingType) &&
EmbeddedLanguages\Json\LanguageServices\JsonLanguageDetector.cs (2)
153_typesOfInterest.Contains(symbol.ContainingType) && 156options = symbol.ContainingType.Name == nameof(JsonDocument) ? JsonOptions.Strict : default;
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (3)
142if (_regexType.Equals(constructor?.ContainingType)) 153if (_regexType.Equals(constructor?.ContainingType)) 175regexType.Equals(method.ContainingType))
EncapsulateField\AbstractEncapsulateFieldService.cs (4)
242field.ContainingType, 269var constructorLocations = GetConstructorLocations(solution, field.ContainingType); 282constructorLocations = GetConstructorLocations(solution, field.ContainingType); 362var destination = field.ContainingType;
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (3)
153var typeSymbol = symbol.ContainingType; 172=> EnqueueWorkItemAsync(document, symbol.ContainingType != null ? symbol.ContainingType.Locations : symbol.Locations);
ExtractClass\AbstractExtractClassRefactoringProvider.cs (1)
87var containingType = selectedMembers.First().ContainingType;
ExtractMethod\MethodExtractor.Analyzer.cs (2)
694parameter.ContainingSymbol.ContainingType != null && 695parameter.ContainingSymbol.ContainingType.IsScriptClass;
FindUsages\FindUsagesHelpers.cs (1)
19=> symbol.IsConstructor() ? symbol.ContainingType.Name : symbol.Name;
FindUsages\IDefinitionsAndReferencesFactory.cs (1)
228rqName = RQNameInternal.From(definition.ContainingType);
GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.AbstractCodeAction.cs (1)
85if (baseConstructor.ContainingType.IsAbstractClass() && !classType.IsAbstractClass())
GenerateFromMembers\AbstractGenerateFromMembersCodeRefactoringProvider.cs (1)
43var containingType = selectedMembers.First().ContainingType;
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.cs (3)
60if (!delegatedConstructor.ContainingType.Equals(currentConstructor.ContainingType)) 65var constructorsCount = delegatedConstructor.ContainingType.InstanceConstructors.Length;
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.State.cs (2)
222if (TypeToGenerateIn.Equals(constructor.ContainingType) && 584var isThis = _delegatedConstructor.ContainingType.OriginalDefinition.Equals(TypeToGenerateIn.OriginalDefinition);
GenerateMember\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
172var parameterNames = delegateInvokeMethod.ContainingType is { Name: nameof(Action) or nameof(Func<int>), ContainingNamespace.Name: nameof(System) }
GenerateMember\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
386symbol.ContainingType.Equals(ContainingType))
GoToBase\AbstractGoToBaseService.cs (2)
22var baseType = constructor.ContainingType.BaseType; 27baseConstructor => baseConstructor.IsAccessibleWithin(constructor.ContainingType) &&
HashCodeAnalyzer.OperationDeconstructor.cs (4)
88Equals(_analyzer._equalityComparerType, targetMethod.ContainingType.OriginalDefinition) && 132Equals(_method.ContainingType.BaseType, instanceReference.Type)) 154Equals(fieldOrProp.ContainingType.OriginalDefinition, _method.ContainingType))
ImplementInterface\AbstractImplementInterfaceService.AccessibilityHelper.cs (1)
135if (IsTypeLessAccessibleThanOtherType(first.ContainingType, second, alreadyCheckingTypes))
ImplementInterface\AbstractImplementInterfaceService.CodeAction.cs (1)
282string.Format("{0}_{1}", member.ContainingType.Name, member.Name),
ImplementInterface\AbstractImplementInterfaceService.DisposePatternCodeAction.cs (2)
77var idisposableType = disposeMethod.ContainingType; 143unimplementedMembers.WhereAsArray(m => !m.type.Equals(disposeMethod.ContainingType)),
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (2)
303return targetMethod.ContainingType.SpecialType == SpecialType.System_String; 500var containingType = parameter.ContainingType;
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (6)
297var defaultAccessibility = DetermineDefaultFieldAccessibility(parameter.ContainingType); 320var containingType = parameter.ContainingType; 460if (fieldOrProperty.ContainingType == null) 679var containingType = parameter.ContainingType; 738var containingType = parameter.ContainingType; 793if (IsFieldOrPropertyAssignment(statement, member.ContainingType, out var assignmentExpression) &&
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (2)
92methodSymbol.ContainingType.TypeKind == TypeKind.Interface) 235memberReference.Member.ContainingType.Equals(containingType))
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
459: CodeGenerationSymbolFactory.CreateMethodSymbol(_methodSymbol, statements: ImmutableArray.Create(newStatement), containingType: _methodSymbol.ContainingType);
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.cs (4)
170if (n1.Equals(property.ContainingType) && !n2.Equals(property.ContainingType)) 174else if (!n1.Equals(property.ContainingType) && n2.Equals(property.ContainingType))
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (2)
582if (symbol.ContainingType != null && symbol.ContainingType.TypeKind == TypeKind.Enum)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
39public INamedTypeSymbol ContainingType => _symbol.ContainingType;
MoveStaticMembers\AbstractMoveStaticMembersRefactoringProvider.cs (2)
52var containingType = selectedMembers.First().ContainingType; 54if (selectedMembers.Any(m => !m.ContainingType.Equals(containingType)))
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (2)
61var containingType = selectedMembers.First().ContainingType; 63if (selectedMembers.Any(m => !m.ContainingType.Equals(containingType)))
PullMemberUp\MembersPuller.cs (2)
133if (analysisResult.Member.ContainingType.TypeKind == TypeKind.Interface) 538var implementationOfMember = selectedMember.ContainingType.FindImplementationForInterfaceMember(interfaceMember);
Rename\SymbolicRenameInfo.cs (5)
156if (triggerSymbol.ContainingType?.IsTupleType == true) 190symbol.ContainingType != null && 191symbol.ContainingType.IsDelegateType() && 192symbol.ContainingType.AssociatedSymbol != null)) 200if (symbol.Kind == SymbolKind.Property && symbol.ContainingType.IsAnonymousType)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (4)
71n => !methodSymbol.ContainingType.GetMembers(n).Any()) 105var containingType = getMethod.ContainingType; 119getMethod.ContainingType != null && 132if (current.ContainingType.SpecialType == SpecialType.System_Object)
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (3)
44return propertyBackingField.ContainingType == null 47generator.TypeExpression(propertyBackingField.ContainingType), 325? Generator.TypeExpression(_property.ContainingType)
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (4)
145property.ContainingType.GetMembers(GetPrefix + name) 154property.ContainingType 178n => !property.ContainingType.GetMembers(n).Any()); 381if (property.ContainingType.TypeKind == TypeKind.Interface)
RQName\RQNodeBuilder.cs (10)
79for (var currentType = type; currentType != null; currentType = currentType.ContainingType) 89var containingType = BuildUnconstructedNamedType(symbol.ContainingType); 112var interfaceType = BuildType(symbol.ExplicitInterfaceImplementations.Single().ContainingType); 122var containingType = BuildUnconstructedNamedType(symbol.ContainingType); 171var containingType = BuildUnconstructedNamedType(symbol.ContainingType); 187var interfaceType = BuildType(symbol.ExplicitInterfaceImplementations.Single().ContainingType); 232var interfaceType = BuildType(symbol.ExplicitInterfaceImplementations.Single().ContainingType); 240var containingType = BuildUnconstructedNamedType(symbol.ContainingType); 312while (type.ContainingType != null) 314type = type.ContainingType;
Shared\Extensions\ISymbolExtensions_2.cs (1)
39var containingType = symbol.ContainingType;
Shared\Utilities\ExtractTypeHelpers.cs (3)
175currentType = currentType.ContainingType; 239if (type.ContainingType != null && 241DoesTypeReferenceTypeParameter(type.ContainingType, typeParameter, checkedTypes))
SolutionCrawler\WorkCoordinator.SemanticChangeProcessor.cs (3)
152var typeSymbol = symbol.ContainingType; 171=> EnqueueWorkItemAsync(document, symbol.ContainingType != null ? symbol.ContainingType.Locations : symbol.Locations);
StackTraceExplorer\StackTraceExplorerUtilities.cs (1)
99symbol = method.ContainingType;
SuppressMessageAttributeState.cs (1)
69_suppressMessageAttributeType.Equals(propertyReference.Property.ContainingType))
SuppressMessageAttributeState.TargetSymbolResolver.cs (6)
526var typeParameter = GetNthTypeParameter(bindingContext.ContainingType, typeParameterIndex); 560for (var containingType = bindingContext.ContainingType; containingType != null; containingType = containingType.ContainingType) 838var containingTypeParameterCount = GetTypeParameterCount(typeSymbol.ContainingType); 841return GetNthTypeParameter(typeSymbol.ContainingType, n); 861return typeSymbol.TypeParameters.Length + GetTypeParameterCount(typeSymbol.ContainingType);
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
294var constructorSpans = field.ContainingType.GetMembers()
UseExplicitTupleNameDiagnosticAnalyzer.cs (2)
51if (field.ContainingType.IsTupleType) 55var namedField = GetNamedField(field.ContainingType, field, context.CancellationToken);
UseNamedMemberInitializerAnalyzer.cs (1)
190if (member != null && member.ContainingType.IsInterfaceType())
UseSystemHashCodeCodeFixProvider.cs (1)
78var containingType = accessesBase ? method!.ContainingType : null;
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator (2)
Generator.cs (2)
284else if (symbol.ContainingType != null && symbol.DeclaredAccessibility == Accessibility.Private && symbol.ContainingType.Locations.Length == 1)
Microsoft.CodeAnalysis.Scripting (1)
ScriptBuilder.cs (1)
191string entryPointTypeName = MetadataHelpers.BuildQualifiedName(entryPoint.ContainingNamespace.MetadataName, entryPoint.ContainingType.MetadataName);
Microsoft.CodeAnalysis.Test.Utilities (16)
Compilation\ControlFlowGraphVerifier.cs (4)
947Constructor.ContainingType: INamedTypeSymbol ctorContainingType, 972TargetMethod: { Name: BoundInterpolatedString.AppendFormattedMethod or BoundInterpolatedString.AppendLiteralMethod, ContainingType: INamedTypeSymbol containingType } 2017ContainingType: INamedTypeSymbol 2020ContainingType: null,
Diagnostics\BoxingOperationAnalyzer.cs (1)
64invocation.TargetMethod.ContainingType.IsReferenceType)
Diagnostics\CommonDiagnosticAnalyzers.cs (9)
1469sortedCallbackOperationBlockStartNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 1472sortedCallbackOperationNames.Add($"{context.ContainingSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"), 1476sortedCallbackOperationBlockEndNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})")); 1487sortedCallbackOperationBlockNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 1501sortedCallbackCodeBlockStartNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 1504sortedCallbackCodeBlockEndNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})")); 1514sortedCallbackCodeBlockNames.Add($"{context.OwningSymbol.ContainingType.Name}(IsGeneratedCode:{context.IsGeneratedCode})"); 2009if (symbolEnded.ContainingType != null) 2011containersToVerify.Add(symbolEnded.ContainingType);
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (2)
49ITypeSymbol staticConstructorType = containingMethod.MethodKind == MethodKind.StaticConstructor ? containingMethod.ContainingType : null; 127if (staticConstructorType != null && targetField.IsStatic && targetField.ContainingType == staticConstructorType)
Microsoft.CodeAnalysis.VisualBasic (13)
Operations\VisualBasicOperationFactory.vb (1)
1620propertySym.ContainingType,
SymbolDisplay\SymbolDisplayVisitor.Members.vb (5)
29If symbol.ContainingType.TypeKind = TypeKind.Enum Then 98If format.MemberOptions.IncludesOption(SymbolDisplayMemberOptions.IncludeContainingType) AndAlso IncludeNamedType(symbol.ContainingType) Then 99symbol.ContainingType.Accept(Me.NotFirstVisitor) 134If format.MemberOptions.IncludesOption(SymbolDisplayMemberOptions.IncludeContainingType) AndAlso IncludeNamedType(symbol.ContainingType) Then 135symbol.ContainingType.Accept(Me.NotFirstVisitor)
SymbolDisplay\SymbolDisplayVisitor.Types.vb (1)
159Dim containingType = symbol.ContainingType
SymbolDisplay\SymbolDisplayVisitor.vb (3)
315Dim containingType = symbol.ContainingType 364symbol.ContainingType IsNot Nothing AndAlso 365symbol.ContainingType.TypeKind = TypeKind.Enum AndAlso
SymbolDisplay\SymbolDisplayVisitor_Minimal.vb (2)
100If IncludeNamedType(symbol.ContainingType) Then 101symbol.ContainingType.Accept(NotFirstVisitor)
Symbols\Symbol.vb (1)
1162Private ReadOnly Property ISymbol_ContainingType As INamedTypeSymbol Implements ISymbol.ContainingType
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (13)
ExpressionSyntaxGeneratorVisitor.vb (3)
39If symbol.ContainingType IsNot Nothing Then 40If symbol.ContainingType.TypeKind = TypeKind.Submission Then 43Dim container = symbol.ContainingType.Accept(Me)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb\SymbolExtensions.vb (2)
35Dim containingType = symbol.ContainingType 37containingType.ContainingType IsNot Nothing OrElse
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb\SymbolExtensions.vb (4)
17If propertySymbol.ContainingType IsNot Nothing AndAlso 18propertySymbol.ContainingType.Name = "MyForms" AndAlso 19propertySymbol.ContainingType.ContainingNamespace IsNot Nothing AndAlso 20propertySymbol.ContainingType.ContainingNamespace.IsMyNamespace(compilation) Then
TypeSyntaxGeneratorVisitor.vb (3)
159If symbol.ContainingType IsNot Nothing Then 160If symbol.ContainingType.TypeKind = TypeKind.Submission Then 163Return AddInformationTo(SyntaxFactory.QualifiedName(DirectCast(symbol.ContainingType.Accept(Me), NameSyntax), simpleNameSyntax), symbol)
VisualBasicSyntaxContext.vb (1)
254Return If(TryCast(enclosingSymbol, INamedTypeSymbol), enclosingSymbol.ContainingType)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
EndConstructGeneration\EndConstructStatementVisitor.vb (1)
107If boundConstructor.ContainingType.IsDesignerGeneratedTypeWithInitializeComponent(_state.SemanticModel.Compilation) Then
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler.UnitTests (1)
ExpressionCompilerTestBase.vb (1)
475Dim typeName = method.ContainingType.Name
Microsoft.CodeAnalysis.VisualBasic.Features (29)
ChangeSignature\VisualBasicChangeSignatureService.vb (2)
708If Equals(convertedType, symbol.ContainingType) Then 727If Equals(nodeType, symbol.ContainingType) Then
Completion\CompletionProviders\EnumCompletionProvider.vb (3)
111If Not Equals(_cachedDisplayAndInsertionTextContainingType, symbol.ContainingType) OrElse _cachedDisplayAndInsertionTextContext IsNot context Then 114_cachedDisplayAndInsertionTextContainingTypeText = symbol.ContainingType.ToMinimalDisplayString(context.SemanticModel, context.Position, displayFormat) 115_cachedDisplayAndInsertionTextContainingType = symbol.ContainingType
Completion\CompletionProviders\HandlesClauseCompletionProvider.vb (2)
85containingType = containingSymbol.ContainingType 109containingType = containingSymbol.ContainingType
Completion\CompletionProviders\OverrideCompletionProvider.vb (1)
193If overriddenMember.ContainingType.SpecialType = SpecialType.System_Object Then
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (2)
2494If newSymbol.ContainingType.Arity > 0 AndAlso newSymbol.Kind <> SymbolKind.NamedType Then 2521If newSymbol.ContainingType.TypeKind = TypeKind.Enum Then
EncapsulateField\VisualBasicEncapsulateFieldService.vb (4)
116Dim containingTypeMemberNames = field.ContainingType.GetAccessibleMembersInThisAndBaseTypes(Of ISymbol)(field.ContainingType).Select(Function(s) s.Name) 129Dim containingTypeMemberNames = field.ContainingType.GetAccessibleMembersInThisAndBaseTypes(Of ISymbol)(field.ContainingType).Select(Function(s) s.Name)
NavigationBar\VisualBasicNavigationBarItemService.vb (3)
250If type.ContainingType IsNot Nothing Then 251name &= " (" & type.ContainingType.ToDisplayString() & ")" 430member.ContainingType.GetSymbolKey(cancellationToken),
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.vb (1)
179explicitInterfaceImplMethod, name:=desiredName, containingType:=explicitInterfaceImplMethod.ContainingType)
SignatureHelp\AbstractOrdinaryMethodSignatureHelpProvider.vb (1)
37result.AddRange(symbol.ContainingType.ToMinimalDisplayParts(semanticModel, position))
SignatureHelp\AttributeSignatureHelpProvider.vb (2)
113Dim namedParameters = constructor.ContainingType.GetAttributeNamedParameters(semanticModel.Compilation, within). 183result.AddRange(method.ContainingType.ToMinimalDisplayParts(semanticModel, position))
SignatureHelp\InvocationExpressionSignatureHelpProvider.DelegateInvoke.vb (2)
42If invokeMethod.ContainingType.IsAnonymousType Then 45displayParts.AddRange(invokeMethod.ContainingType.ToMinimalDisplayParts(semanticModel, position))
SignatureHelp\InvocationExpressionSignatureHelpProvider.ElementAccess.vb (1)
55result.AddRange(symbol.ContainingType.ToMinimalDisplayParts(semanticModel, position))
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.DelegateType.vb (1)
40result.AddRange(invokeMethod.ContainingType.ToMinimalDisplayParts(semanticModel, position))
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.NormalType.vb (1)
62result.AddRange(method.ContainingType.ToMinimalDisplayParts(semanticModel, position))
SignatureHelp\RaiseEventStatementSignatureHelpProvider.vb (3)
79Dim containingType = semanticModel.GetEnclosingSymbol(position, cancellationToken).ContainingType 87Dim allowedEvents = events.WhereAsArray(Function(s) s.Kind = SymbolKind.Event AndAlso Equals(s.ContainingType, containingType)). 136result.AddRange(eventSymbol.ContainingType.ToMinimalDisplayParts(semanticModel, position))
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (3)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (1)
1322Assert.Equal("Event N1.Test.Percent(Percent As System.Single)", paramSymbol1.ContainingType.AssociatedSymbol.ToTestDisplayString())
Semantics\ForeachTest.vb (1)
1256Assert.Equal(comp.GetSpecialType(SpecialType.System_Array), loopInfo0.GetEnumeratorMethod.ContainingType) ' Unlike C#, the spec doesn't say that arrays use IEnumerable
Semantics\GetSemanticInfoTests.vb (1)
3089Assert.Equal("C0", we.ContainingType.Name)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (4)
SymbolsTests\Source\EventTests.vb (4)
2513Assert.Same(e1.Type, xSym.ContainingType) 2514Assert.Same(xSym, xSym.ContainingType.DelegateInvokeMethod.Parameters.First()) 2567Assert.Same(e1.Type, xSym.ContainingType) 2568Assert.Same(xSym, xSym.ContainingType.DelegateInvokeMethod.Parameters.First())
Microsoft.CodeAnalysis.VisualBasic.Workspaces (46)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (1)
160symbol = symbol.ContainingType
Classification\SyntaxClassification\NameSyntaxClassifier.vb (1)
198Return If(fieldSymbol.ContainingType.IsEnumType(), ClassificationTypeNames.EnumMemberName, ClassificationTypeNames.ConstantName)
CodeGeneration\FieldGenerator.vb (1)
96Dim canUseFieldReference = field.Type IsNot Nothing AndAlso Not field.Type.Equals(field.ContainingType)
CodeGeneration\VisualBasicCodeGenerationHelpers.vb (2)
68If explicitInterfaceOpt IsNot Nothing AndAlso explicitInterfaceOpt.ContainingType IsNot Nothing Then 69Dim type = explicitInterfaceOpt.ContainingType.GenerateTypeSyntax()
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
2866Dim interfaceName = method.ContainingType.GenerateTypeSyntax()
ExpressionSyntaxGeneratorVisitor.vb (3)
39If symbol.ContainingType IsNot Nothing Then 40If symbol.ContainingType.TypeKind = TypeKind.Submission Then 43Dim container = symbol.ContainingType.Accept(Me)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb\SymbolExtensions.vb (2)
35Dim containingType = symbol.ContainingType 37containingType.ContainingType IsNot Nothing OrElse
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb\SymbolExtensions.vb (4)
17If propertySymbol.ContainingType IsNot Nothing AndAlso 18propertySymbol.ContainingType.Name = "MyForms" AndAlso 19propertySymbol.ContainingType.ContainingNamespace IsNot Nothing AndAlso 20propertySymbol.ContainingType.ContainingNamespace.IsMyNamespace(compilation) Then
Recommendations\VisualBasicRecommendationServiceRunner.vb (3)
114Dim containingType = _context.SemanticModel.GetEnclosingSymbol(_context.Position, _cancellationToken).ContainingType 118.WhereAsArray(Function(s) s.Kind = SymbolKind.Event AndAlso Equals(s.ContainingType, containingType)) 343symbols = symbols.WhereAsArray(Function(s) s.Kind <> SymbolKind.Field OrElse Not s.ContainingType.IsEnumType() OrElse s.Name <> WellKnownMemberNames.EnumBackingFieldName)
Rename\VisualBasicRenameRewriterLanguageService.vb (7)
335symbol.ContainingType.IsImplicitlyDeclared AndAlso 336symbol.ContainingType.IsDelegateType AndAlso 337symbol.ContainingType.AssociatedSymbol IsNot Nothing Then 784If renamedSymbol.ContainingType IsNot Nothing AndAlso renamedSymbol.ContainingType.GetMembers(renamedSymbol.Name).Contains(renamedSymbol) Then 785Dim conflictingLocations = renamedSymbol.ContainingType.TypeParameters _ 928Dim baseType = renamedSymbol.ContainingType?.GetBaseTypes().FirstOrDefault()
Simplification\Reducers\VisualBasicEscapingReducer.vb (2)
104If symbol.ContainingType IsNot Nothing Then 105Dim type = symbol.ContainingType
Simplification\Simplifiers\AbstractVisualBasicSimplifier.vb (1)
73symbol = symbol.ContainingType
Simplification\Simplifiers\ExpressionSimplifier.vb (1)
241Dim containingType As INamedTypeSymbol = rightSymbol.ContainingType
Simplification\Simplifiers\NameSimplifier.vb (2)
43symbol = symbol.ContainingType 331symbolForName = symbolForName.ContainingType
Simplification\VisualBasicSimplificationService.Expander.vb (11)
253Dim containingType = reducedExtensionMethod.ContainingType.ToDisplayString(symbolDisplayFormat) 425If Not symbolForQualifiedName.ContainingType.Equals(symbolForLeftPart) Then 428Dim moduleIdentifierToken = SyntaxFactory.Identifier(symbolForQualifiedName.ContainingType.Name) 455If Not symbolForMemberAccess.ContainingType.Equals(symbolForLeftPart) Then 458Dim moduleIdentifierToken = SyntaxFactory.Identifier(symbolForMemberAccess.ContainingType.Name) 574If symbol.IsConstructor() AndAlso symbol.ContainingType?.IsAttribute() Then 575symbol = symbol.ContainingType 630symbol = symbol.ContainingType 659If Not Equals(_semanticModel.GetEnclosingNamedType(originalSimpleName.SpanStart, _cancellationToken), symbol.ContainingType) Then 718If replaceNode OrElse symbol.ContainingType IsNot Nothing OrElse symbol.ContainingNamespace IsNot Nothing Then 804type = type.ContainingType
TypeSyntaxGeneratorVisitor.vb (3)
159If symbol.ContainingType IsNot Nothing Then 160If symbol.ContainingType.TypeKind = TypeKind.Submission Then 163Return AddInformationTo(SyntaxFactory.QualifiedName(DirectCast(symbol.ContainingType.Accept(Me), NameSyntax), simpleNameSyntax), symbol)
VisualBasicSyntaxContext.vb (1)
254Return If(TryCast(enclosingSymbol, INamedTypeSymbol), enclosingSymbol.ContainingType)
Microsoft.CodeAnalysis.Workspaces (137)
AbstractCodeGenerationService.cs (1)
377return field != null && field.ContainingType.IsEnumType();
AbstractFlagsEnumGenerator.cs (1)
46var type = ctor.ContainingType;
AbstractSpeculationAnalyzer.cs (10)
383var type = methodSymbol.ContainingType; 384var newType = newMethodSymbol.ContainingType; 707&& symbol.ContainingType.SpecialType == SpecialType.System_Object 845symbol.ContainingType != null && 846symbol.ContainingType.IsAnonymousType(); 901if (newSymbol.ContainingType.IsDelegateType() && 902symbol.ContainingType.IsDelegateType() && 903IsReferenceConversion(this.OriginalSemanticModel.Compilation, newSymbol.ContainingType, symbol.ContainingType)) 957var newSymbolContainingType = newSymbol.ContainingType;
AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
127symbol.ContainingType?.SpecialType == SpecialType.System_Enum;
Classification\SyntaxClassification\AbstractNameSyntaxClassifier.cs (1)
24symbol = symbol.ContainingType;
CodeGenerationConstructorInfo.cs (1)
84=> info == null ? constructor.ContainingType.Name : info._typeName;
CodeGenerationDestructorInfo.cs (1)
53=> info == null ? constructor.ContainingType.Name : info._typeName;
Editing\SyntaxGenerator.cs (3)
565constructorMethod.ContainingType != null ? constructorMethod.ContainingType.Name : "New", 827if (symbol.ContainingType?.IsRecord is true)
FindSymbols\FindReferences\BaseTypeFinder.cs (1)
27foreach (var type in FindBaseTypes(symbol.ContainingType))
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (2)
58if (symbol.ContainingType != null && symbol.ContainingType.IsScriptClass)
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (1)
779var containingType = definition.ContainingType;
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (1)
198var attributeSymbol = semanticModel.GetSymbolInfo(attributeNode, cancellationToken).Symbol?.ContainingType;
FindSymbols\FindReferences\Finders\ConstructorInitializerSymbolReferenceFinder.cs (2)
50}, symbol.ContainingType.Name, cancellationToken); 67static (token, tuple) => TokensMatch(tuple.state, token, tuple.methodSymbol.ContainingType.Name, tuple.cancellationToken),
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (6)
31var containingType = symbol.ContainingType; 43var containingType = symbol.ContainingType; 44var typeName = symbol.ContainingType.Name; 106var name = methodSymbol.ContainingType.Name; 127methodSymbol.ContainingType, state, typeReferences, cancellationToken).ConfigureAwait(false); 178var predefinedType = symbol.ContainingType.SpecialType.ToPredefinedType();
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (2)
24var backingFields = symbol.ContainingType.GetMembers() 29var associatedNamedTypes = symbol.ContainingType.GetTypeMembers()
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (1)
60symbol.DeclaringMethod.ContainingType.Name);
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (2)
29return symbol.ContainingType.TypeKind == TypeKind.Delegate 30? new(ImmutableArray.Create<ISymbol>(symbol.ContainingType))
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (2)
205var containingType = containingMethod.ContainingType; 216else if (containingMethod.ContainingType.IsDelegateType() &&
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (2)
41foreach (var member in symbol.ContainingType.GetMembers()) 63ContainingType:
FindSymbols\FindReferences\Finders\TypeParameterSymbolReferenceFinder.cs (1)
32return FindDocumentsAsync(project, documents, cancellationToken, symbol.Name, symbol.ContainingType.Name);
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (2)
118if (searchSymbol.IsConstructor() && searchSymbol.ContainingType.TypeKind == TypeKind.Delegate) 119searchSymbol = symbol.ContainingType;
FindSymbols\SymbolFinder_Helpers.cs (2)
155Contract.ThrowIfFalse(equivalentTypesWithDifferingAssemblies.All(kvp => kvp.Key.ContainingType == null)); 156Contract.ThrowIfFalse(equivalentTypesWithDifferingAssemblies.All(kvp => kvp.Value.ContainingType == null));
FindSymbols\SymbolFinder_Hierarchy.cs (4)
46var containingType = symbol.ContainingType; 119if (symbol is { DeclaredAccessibility: Accessibility.Public, ContainingType.TypeKind: TypeKind.Class or TypeKind.Struct }) 133var containingType = symbol.ContainingType.OriginalDefinition; 352var containingType = symbol.ContainingType.OriginalDefinition;
IParameterSymbolExtensions.cs (2)
32ContainingType: { IsRecord: true } containingType, 64ContainingType: { } containingType,
IPropertySymbolExtensions.cs (1)
12=> property.ContainingType.GetMembers()
ISymbolExtensions_Accessibility.cs (5)
171return IsMemberAccessible(symbol.ContainingType, symbol.DeclaredAccessibility, within, throughType, out failedThroughTypeCheck); 207var containingType = type.ContainingType; 210: IsMemberAccessible(type.ContainingType, type.DeclaredAccessibility, within, null, out _); 404current = current.ContainingType; 450current = current.ContainingType;
ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (2)
57if (symbol.ContainingType != null) 59accessibility = AccessibilityUtilities.Minimum(accessibility, symbol.ContainingType.Accept(this));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs\INamedTypeSymbolExtensions.cs (7)
44for (var current = symbol; current != null; current = current.ContainingType) 55for (var current = symbol; current != null; current = current.ContainingType) 86if (member.ContainingType.TypeKind == TypeKind.Interface) 157if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 262return implementation != null && Equals(implementation.ContainingType, classOrStructType); 281return implementation != null && Equals(implementation.ContainingType, classOrStructType); 615ContainingType.SpecialType: SpecialType.System_Object,
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs\ISymbolExtensions.cs (12)
98var containingType = symbol.ContainingType; 114return symbol?.ContainingType?.TypeKind == TypeKind.Class && 122symbol.ContainingType != null && 123symbol.ContainingType.TypeKind == TypeKind.Interface) 159return symbol.ContainingType; 208=> symbol?.Kind == SymbolKind.Field && symbol.ContainingType.IsEnumType(); 220=> symbol is { ContainingType.TypeKind: TypeKind.Module }; 256=> symbol is IPropertySymbol && symbol.ContainingType.IsNormalAnonymousType(); 259=> symbol is IFieldSymbol { ContainingType.IsTupleType: true }; 380symbol = symbol.ContainingType; 399var containingType = symbol.ContainingType; 403containingType = containingType.ContainingType;
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (5)
138current = current.ContainingType; 144var current = type.ContainingType; 148current = current.ContainingType; 232b.ContainingType == null && 248&& symbol.ContainingType == null
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\INamedTypeSymbolExtensions.cs\INamedTypeSymbolExtensions.cs (1)
20namedType.ContainingType,
NamingStyleRules.cs (2)
73var containingType = symbol.ContainingType; 95var containingType = symbol.ContainingType;
Recommendations\AbstractRecommendationService.cs (1)
128var containingTypeOriginalDefinition = symbol.ContainingType.OriginalDefinition;
Rename\ConflictEngine\ConflictResolver.cs (1)
244var otherThingsNamedTheSame = renamedSymbol.ContainingType.GetMembers(renamedSymbol.Name)
Rename\ConflictEngine\DeclarationConflictHelpers.cs (2)
18renamedMethod.ContainingType.GetMembers(renamedMethod.Name) 29renamedProperty.ContainingType.GetMembers(renamedProperty.Name)
Rename\RenameUtilities.cs (3)
190var containingType = symbol.ContainingType; 224symbol.ContainingType.TypeKind == TypeKind.Interface) 365return methodSymbol.ContainingType;
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
120&& Equals(possibleConstructor.ContainingType.ConstructedFrom, namedType.ConstructedFrom);
Shared\Extensions\IMethodSymbolExtensions.cs (4)
76method.ContainingType, 102method.ContainingType, 129typeParameter.ContainingType, 201containingType: method.ContainingType,
Shared\Extensions\IPropertySymbolExtensions.cs (2)
26property.ContainingType, 52property.ContainingType,
Shared\Extensions\ISymbolExtensions.cs (2)
277if (symbol.ContainingType is null) 480var baseType = memberSymbol.ContainingType.BaseType;
Shared\Extensions\ITypeSymbolExtensions.cs (2)
78var interfaceType = interfaceMember.ContainingType; 87var originalInterfaceType = interfaceMember.ContainingType.OriginalDefinition;
Shared\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (2)
78var updatedContainingType = symbol.ContainingType?.Accept(this); 81if (!Equals(updatedContainingType, symbol.ContainingType))
Shared\Extensions\SemanticModelExtensions.cs (3)
25if (symbol.IsConstructor() && symbol.ContainingType.IsAnonymousType) 27return symbol.ContainingType; 55methodSymbol.ContainingType is ITypeSymbol containingType)
Shared\Extensions\SyntaxGeneratorExtensions.cs (4)
585if (member.ContainingType.IsInterfaceType() && throughMemberType != null) 609var interfaceBeingImplemented = member.ContainingType; 626explicitlyImplementedProperty.ContainingType, 642var classOrStructType = throughMember.ContainingType;
Shared\Utilities\SignatureComparer.cs (4)
175if (property1.ContainingType == null || 176property1.ContainingType.TypeKind == TypeKind.Interface) 185if (property2.ContainingType == null || 186property2.ContainingType.TypeKind == TypeKind.Interface)
SymbolEquivalenceComparer.cs (2)
185x.ContainingType != null && 186x.ContainingType.IsAnonymousType)
SymbolEquivalenceComparer.EquivalenceVisitor.cs (6)
384x.ContainingType == null && 573if (x.ContainingType.IsAnonymousType && y.ContainingType.IsAnonymousType) 604(x.TypeParameterKind == TypeParameterKind.Type && IsConstructedFromSelf(x.ContainingType)) || 608(y.TypeParameterKind == TypeParameterKind.Type && IsConstructedFromSelf(y.ContainingType)) || 625if (x.TypeParameterKind == TypeParameterKind.Type && x.ContainingType.IsAnonymousType)
SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
264(x.TypeParameterKind == TypeParameterKind.Type && IsConstructedFromSelf(x.ContainingType)) || 276if (x.TypeParameterKind == TypeParameterKind.Type && x.ContainingType.IsAnonymousType)
SymbolKey.cs (3)
30/// the "same" <see cref="ISymbol.ContainingType"/> and 33/// the "same" <see cref="ISymbol.ContainingType"/>, 59/// the "same" the "same" <see cref="ISymbol.ContainingType"/>,
SymbolKey.ErrorTypeSymbolKey.cs (1)
116return reader.ReadSymbolKey(contextualType?.ContainingType, out failureReason);
SymbolKey.EventSymbolKey.cs (2)
16visitor.WriteSymbolKey(symbol.ContainingType); 23var containingTypeResolution = reader.ReadSymbolKey(contextualSymbol?.ContainingType, out var containingTypeFailureReason);
SymbolKey.FieldSymbolKey.cs (2)
16visitor.WriteSymbolKey(symbol.ContainingType); 23var containingTypeResolution = reader.ReadSymbolKey(contextualSymbol?.ContainingType, out var containingTypeFailureReason);
SyntaxGeneratorExtensions_Negate.cs (1)
420var containingType = property.ContainingType;
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
FindReferencesTests.cs (2)
482var refsFromVirtualSorted = refsFromVirtual.Select(r => r.Definition).OrderBy(r => r.ContainingType.Name).ToArray(); 483var refsFromOverrideSorted = refsFromOverride.Select(r => r.Definition).OrderBy(r => r.ContainingType.Name).ToArray();
Microsoft.VisualStudio.LanguageServices (20)
CallHierarchy\CallHierarchyItem.cs (1)
48_containingTypeName = symbol.ContainingType.ToDisplayString(ContainingTypeFormat);
Implementation\VsRefactorNotifyService.cs (1)
168symbol = symbol.ContainingType;
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (1)
234BuildMemberOf(symbol.ContainingType);
Library\ObjectBrowser\AbstractListItemFactory.cs (1)
87var containingType = memberSymbol.ContainingType;
Library\ObjectBrowser\Lists\MemberListItem.cs (1)
30if (fieldSymbol.ContainingType.TypeKind == TypeKind.Enum)
Library\VsNavInfo\NavInfoFactory.cs (1)
125className: GetClassName(memberSymbol.ContainingType),
Progression\GraphBuilder.cs (4)
615node[RoslynGraphProperties.TypeKind] = method.ContainingType.TypeKind; 628if (field.ContainingType.TypeKind == TypeKind.Enum) 648node[RoslynGraphProperties.TypeKind] = property.ContainingType.TypeKind; 661node[RoslynGraphProperties.TypeKind] = eventSymbol.ContainingType.TypeKind;
Progression\GraphNodeIdCreation.cs (7)
95items.Add(await GetPartialForTypeAsync(symbol.ContainingType, CodeGraphNodeIdName.Type, solution, cancellationToken).ConfigureAwait(false)); 157if (namedType.ContainingType == null && Equals(namedType.ConstructedFrom, namedType) && namedType.Arity == 0) 203if (namedType.ContainingType != null) 205partials.Add(await GetPartialForTypeAsync(namedType.ContainingType, CodeGraphNodeIdName.ParentType, solution, cancellationToken, hasGenericArguments).ConfigureAwait(false)); 227if (pointerType.PointedAtType.ContainingType != null) 229partials.Add(await GetPartialForTypeAsync(pointerType.PointedAtType.ContainingType, CodeGraphNodeIdName.ParentType, solution, cancellationToken).ConfigureAwait(false)); 291partials.AddRange(await GetPartialsForNamespaceAndTypeAsync(member.ContainingType, true, solution, cancellationToken).ConfigureAwait(false));
ProjectSystem\AbstractEntryPointFinder.cs (2)
67EntryPoints.Add(symbol.ContainingType); 74EntryPoints.Add(symbol.ContainingType);
PullMemberUp\VisualStudioPullMemberUpService.cs (1)
43var containingType = selectedMembers[0].ContainingType;
Microsoft.VisualStudio.LanguageServices.CSharp (6)
LanguageService\CSharpHelpContextService.cs (1)
562var containingType = FormatNamespaceOrTypeSymbol(symbol.ContainingType);
ObjectBrowser\DescriptionBuilder.cs (4)
244if (memberSymbol.ContainingType != null && memberSymbol.ContainingType.TypeKind == TypeKind.Interface) 259fieldSymbol.ContainingType.TypeKind == TypeKind.Enum) 466if (fieldSymbol.ContainingType.TypeKind != TypeKind.Enum)
Progression\CSharpProgressionLanguageService.cs (1)
124case IFieldSymbol f: return f.ContainingType.TypeKind == TypeKind.Enum ? null : f.Type;
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
GlyphExtensionsTests.cs (1)
211symbolMock.SetupGet(s => s.ContainingType).Returns(containingType);
Microsoft.VisualStudio.LanguageServices.Implementation (6)
CodeModel\Collections\ExternalOverloadsCollection.cs (1)
60foreach (var method in symbol.ContainingType.GetMembers(symbol.Name))
CodeModel\Collections\OverloadsCollection.cs (1)
64foreach (var method in symbol.ContainingType.GetMembers(symbol.Name))
CodeModel\ExternalElements\AbstractExternalCodeElement.cs (2)
138if (symbol.ContainingType != null) 140return CodeModelService.CreateCodeType(this.State, this.ProjectId, symbol.ContainingType);
CodeModel\ExternalElements\ExternalCodeFunction.cs (1)
79var methodsOfName = symbol.ContainingType.GetMembers(symbol.Name)
CodeModel\InternalElements\CodeFunction.cs (1)
128var methodsOfName = symbol.ContainingType.GetMembers(symbol.Name)
Microsoft.VisualStudio.LanguageServices.UnitTests (4)
CommonControls\MemberSelectionViewModelTests.vb (1)
185Dim membersInType = memberSymbol.ContainingType.GetMembers().WhereAsArray(Function(member) MemberAndDestinationValidator.IsMemberValid(member))
MoveStaticMembers\MoveStaticMembersViewModelTest.vb (1)
38memberSymbol.ContainingType,
PullMemberUp\PullMemberUpViewModelTest.vb (2)
257Dim baseTypeTree = BaseTypeTreeNodeViewModel.CreateBaseTypeTree(glyphService:=Nothing, workspaceDoc.Project.Solution, memberSymbol.ContainingType, CancellationToken.None) 258Dim membersInType = memberSymbol.ContainingType.GetMembers().WhereAsArray(Function(member) MemberAndDestinationValidator.IsMemberValid(member))
Microsoft.VisualStudio.LanguageServices.VisualBasic (11)
CodeModel\MethodXML\MethodXmlBuilder.vb (7)
147GenerateType(eventSymbol.ContainingType, implicit:=True, assemblyQualify:=True) 372symbolOpt?.ContainingType?.TypeKind = TypeKind.Module Then 374leftHandSymbol = symbolOpt.ContainingType 432If Me.Symbol.ContainingType.InheritsFromOrEquals(symbol.ContainingType) Then 439GenerateType(symbol.ContainingType) 686GenerateType(delegateSymbol.ContainingType, implicit:=True, assemblyQualify:=True)
Help\VisualBasicHelpContextService.vb (1)
116Dim containingType = FormatSymbol(symbol.ContainingType, isContainingType:=True)
ObjectBrowser\DescriptionBuilder.vb (2)
329If memberSymbol.ContainingType IsNot Nothing And memberSymbol.ContainingType.TypeKind = TypeKind.Interface Then
Progression\VisualBasicProgressionLanguageService.vb (1)
82If symbol.Kind = SymbolKind.Field AndAlso symbol.ContainingType.TypeKind = TypeKind.Enum Then