8 implementations of ContainingSymbol
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
91public override ISymbol ContainingSymbol => this.ContainingType;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
82public virtual ISymbol ContainingSymbol => null;
Microsoft.CodeAnalysis.CSharp (2)
Symbols\PublicModel\PreprocessingSymbol.cs (1)
23ISymbol? ISymbol.ContainingSymbol => null;
Symbols\PublicModel\Symbol.cs (1)
63ISymbol ISymbol.ContainingSymbol
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
37public ISymbol ContainingSymbol => _symbol.ContainingSymbol;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Symbol.vb (1)
1211Private ReadOnly Property ISymbol_ContainingSymbol As ISymbol Implements ISymbol.ContainingSymbol
Microsoft.CodeAnalysis.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
91public override ISymbol ContainingSymbol => this.ContainingType;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
82public virtual ISymbol ContainingSymbol => null;
632 references to ContainingSymbol
ConfigurationSchemaGenerator (2)
RuntimeSource\Roslyn\GetBestTypeByMetadataName.cs (2)
108return GetResultantVisibility(symbol.ContainingSymbol); 135symbol = symbol.ContainingSymbol;
ILLink.RoslynAnalyzer (14)
CompilationExtensions.cs (2)
92 return GetResultantVisibility (symbol.ContainingSymbol); 117 symbol = symbol.ContainingSymbol;
DataFlow\LocalDataFlowVisitor.cs (6)
204 Debug.Assert (local.ContainingSymbol is IMethodSymbol or IFieldSymbol, // backing field for property initializers 205 $"{local.ContainingSymbol.GetType ()}: {localReference.Syntax.GetLocation ().GetLineSpan ()}"); 206 return !ReferenceEquals (local.ContainingSymbol, OwningSymbol); 571 if (methodDefinition.ContainingSymbol is IMethodSymbol) { 715 Debug.Assert (operation.Symbol.ContainingSymbol is IMethodSymbol or IFieldSymbol); 822 if (method.OriginalDefinition.ContainingSymbol is IMethodSymbol) {
ISymbolExtensions.cs (2)
140 sb.Append (fieldSymbol.ContainingSymbol.ToDisplayString (ILLinkTypeDisplayFormat)); 158 if (methodSymbol.ContainingSymbol?.Kind == SymbolKind.NamedType) {
RequiresISymbolExtensions.cs (1)
53 if (member.ContainingSymbol is not IMethodSymbol method)
TrimAnalysis\FlowAnnotations.cs (1)
152 var parameterMethod = (IMethodSymbol) parameter.ContainingSymbol;
TrimAnalysis\GenericParameterValue.cs (1)
32 => new string[] { GenericParameter.TypeParameterSymbol.Name, GenericParameter.TypeParameterSymbol.ContainingSymbol.GetDisplayName () };
TrimAnalysis\ParameterProxy.cs (1)
14 Method = new ((IMethodSymbol) parameter.ContainingSymbol);
Microsoft.Analyzers.Extra (7)
CoalesceAnalyzer.cs (4)
42var method = pr.Parameter.ContainingSymbol as IMethodSymbol; 44if (pr.Parameter.ContainingSymbol.IsExternallyVisible() 69var method = pr.Parameter.ContainingSymbol as IMethodSymbol; 71if (pr.Parameter.ContainingSymbol.IsExternallyVisible()
ConditionalAccessAnalyzer.cs (2)
101var method = pr.Parameter.ContainingSymbol as IMethodSymbol; 103if (pr.Parameter.ContainingSymbol.IsExternallyVisible()
Utilities\SymbolExtensions.cs (1)
55symbol = symbol.ContainingSymbol;
Microsoft.Analyzers.Local (1)
Utilities\SymbolExtensions.cs (1)
31symbol = symbol.ContainingSymbol;
Microsoft.AspNetCore.App.Analyzers (3)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (2)
368if (attributeTypeSymbol.ContainingSymbol is ITypeSymbol typeSymbol && 374if (SymbolEqualityComparer.Default.Equals(attributeTypeSymbol.ContainingSymbol, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_AsParametersAttribute)))
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
220if (parameterSymbol is { ContainingSymbol: IMethodSymbol constructor })
Microsoft.AspNetCore.App.SourceGenerators (1)
PublicTopLevelProgramGenerator.cs (1)
24.Select(static (symbol, _) => symbol?.ContainingSymbol)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
220if (parameterSymbol is { ContainingSymbol: IMethodSymbol constructor })
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (2)
HubClientProxyGenerator.Parser.cs (1)
210var registerCallbackProviderClassSymbol = (INamedTypeSymbol)registerCallbackProviderMethodSymbol.ContainingSymbol;
HubServerProxyGenerator.Parser.cs (1)
199var getProxyClassSymbol = (INamedTypeSymbol)getProxyMethodSymbol.ContainingSymbol;
Microsoft.CodeAnalysis (24)
DiagnosticAnalyzer\AnalyzerDriver.cs (3)
2185if (symbol.ContainingSymbol != null) 2188var containerActions = await driver.GetPerSymbolAnalyzerActionsAsync(symbol.ContainingSymbol, analyzer, filterTree, filterSpan, cancellationToken).ConfigureAwait(false); 2194if (symbol.ContainingSymbol.Kind != symbol.Kind)
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
801var parameterType = BindParameterOrReturnType(symbol.ContainingSymbol, parameterInfo.Type);
DocumentationCommentId.cs (16)
267symbol = symbol.ContainingSymbol as INamedTypeSymbol; 420if (this.Visit(symbol.ContainingSymbol)) 431if (this.Visit(symbol.ContainingSymbol)) 442if (this.Visit(symbol.ContainingSymbol)) 457if (this.Visit(symbol.ContainingSymbol)) 494this.GetReferenceGenerator(p.ContainingSymbol).Visit(p.Type); 512if (this.Visit(symbol.ContainingSymbol)) 523if (this.Visit(symbol.ContainingSymbol)) 559if (this.Visit(symbol.ContainingSymbol)) 657Debug.Assert(symbol.ContainingSymbol is null or INamedTypeSymbol or IMethodSymbol); 659declarer.Visit(symbol.ContainingSymbol); 673var container = symbol.ContainingSymbol?.ContainingSymbol; 685var typeParameterDeclarer = typeParameterSymbol.ContainingSymbol; 687for (var scope = _typeParameterContext; scope != null; scope = scope.ContainingSymbol) 1320if (ParseParameterList(id, ref index, compilation, propertySymbol.ContainingSymbol, parameters)
SourceGeneration\GeneratedCodeUtilities.cs (2)
45return symbol.ContainingSymbol != null && IsGeneratedSymbolWithGeneratedCodeAttribute(symbol.ContainingSymbol, generatedCodeAttribute);
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (2)
198var containingSymbol = type.ContainingSymbol; 201((INamespaceSymbol)containingSymbol.ContainingSymbol).IsGlobalNamespace)
Microsoft.CodeAnalysis.CodeStyle (66)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
537unusedParameter.ContainingSymbol.IsLocalFunction())
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (4)
135!ShouldReportUnusedParameters(parameter.ContainingSymbol, option.Value, option.Notification.Severity)) 143isPublicApiParameter: parameter.ContainingSymbol.HasPublicResultantVisibility(), 144isLocalFunctionParameter: parameter.ContainingSymbol.IsLocalFunction()); 206parameter.ContainingSymbol is not IMethodSymbol method ||
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
801var parameterType = BindParameterOrReturnType(symbol.ContainingSymbol, parameterInfo.Type);
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (2)
45return symbol.ContainingSymbol != null && IsGeneratedSymbolWithGeneratedCodeAttribute(symbol.ContainingSymbol, generatedCodeAttribute);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (2)
28ContainingSymbol: IMethodSymbol 60ContainingSymbol: IMethodSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (4)
43return GetResultantVisibility(symbol.ContainingSymbol); 70symbol = symbol.ContainingSymbol; 373if (symbol.ContainingSymbol is IMethodSymbol method) 391var method = parameter.ContainingSymbol as IMethodSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (2)
155if (symbol.ContainingSymbol.IsKind(SymbolKind.DynamicType)) 161if (symbol.ContainingSymbol is IPointerTypeSymbol pointerType)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
70symbol = symbol.ContainingSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
160for (var currentSymbol = symbol; currentSymbol != null; currentSymbol = currentSymbol.ContainingSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (1)
70var container = symbol.ContainingSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (5)
43/// the "same" <see cref="ISymbol.ContainingSymbol"/>, 48/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 54/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 64/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 67/// the "same" <see cref="ISymbol.ContainingSymbol"/> and
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ErrorTypeSymbolKey.cs (1)
20switch (symbol.ContainingSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (2)
133visitor.WriteSymbolKey(symbol.ContainingSymbol); 165var containingType = reader.ReadSymbolKey(contextualSymbol?.ContainingSymbol, out var containingTypeFailureReason);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (2)
16=> visitor.WriteSymbolKey(symbol.ContainingSymbol); 21var containingSymbolResolution = reader.ReadSymbolKey(contextualSymbol?.ContainingSymbol, out var containingSymbolFailureReason);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (3)
19visitor.WriteSymbolKey(symbol.ContainingSymbol); 42var containingSymbolResolution = reader.ReadSymbolKey(contextualSymbol?.ContainingSymbol, out var containingSymbolFailureReason); 124if (containingSymbolResolution.SymbolCount == 0 && errorType.ContainingSymbol is INamespaceSymbol containingNamespace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ParameterSymbolKey.cs (2)
20visitor.WriteSymbolKey(symbol.ContainingSymbol); 33contextualSymbol?.ContainingSymbol, out var containingSymbolFailureReason);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PropertySymbolKey.cs (2)
18visitor.WriteSymbolKey(symbol.ContainingSymbol); 30var containingTypeResolution = reader.ReadSymbolKey(contextualSymbol?.ContainingSymbol, out var containingTypeFailureReason);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterSymbolKey.cs (2)
26visitor.WriteSymbolKey(symbol.ContainingSymbol); 52var containingSymbolResolution = reader.ReadSymbolKey(contextualSymbol?.ContainingSymbol, out var containingSymbolFailureReason);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (2)
469parameterSymbol.ContainingSymbol.IsAnonymousOrLocalFunction() && 470newParameterSymbol.ContainingSymbol.IsAnonymousOrLocalFunction())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (18)
156AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies); 217if (!AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies)) 368x.ContainingSymbol is INamespaceSymbol xNamespace && 369y.ContainingSymbol is INamespaceSymbol yNamespace) 390if (!AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies)) 561return AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies); 571AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies); 605AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies); 612AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies); 652return AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (8)
93GetHashCode(x.ContainingSymbol, currentHash)); 129currentHash = GetHashCode(x.ContainingSymbol, currentHash); 178GetHashCode(x.ContainingSymbol, currentHash)))))))); 220GetHashCode(x.ContainingSymbol, currentHash))); 229GetHashCode(x.ContainingSymbol, currentHash)))); 247GetHashCode(x.ContainingSymbol, currentHash)))))); 256GetHashCode(x.ContainingSymbol, currentHash)); 288GetHashCode(x.ContainingSymbol, currentHash);
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
194if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.Constructor, DeclaringSyntaxReferences: [var reference] } constructor)
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
114for (ISymbol current = symbol; current != null; current = current.ContainingSymbol)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
401symbol = symbol.ContainingSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (2)
49var containingSymbol = type.ContainingSymbol; 52((INamespaceSymbol)containingSymbol.ContainingSymbol).IsGlobalNamespace)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\InitializeParameterHelpersCore.cs (1)
20if (parameter.ContainingSymbol is IMethodSymbol method)
Microsoft.CodeAnalysis.CSharp (5)
SymbolDisplay\SymbolDisplayVisitor.cs (1)
371Debug.Assert((object)containingType != null || (symbol.ContainingSymbol is ITypeSymbol));
SymbolDisplay\SymbolDisplayVisitor.Members.cs (3)
311if ((object?)symbol.ContainingType != null || (symbol.ContainingSymbol is ITypeSymbol)) 407containingType = (ITypeSymbol)symbol.ContainingSymbol; 926Debug.Assert(containingType != null || (symbol.ContainingSymbol is ITypeSymbol));
SymbolDisplay\SymbolDisplayVisitor.Types.cs (1)
275var containingSymbol = symbol.ContainingSymbol;
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
581if (parameter.ContainingSymbol is not IMethodSymbol method)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
325ContainingSymbol: INamespaceSymbol { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true }
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
314var positionalParam = param.ContainingSymbol.ContainingType.GetMembers().FirstOrDefault(member
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
135typeToGenerateIn = symbolInfo.CandidateSymbols.FirstOrDefault().ContainingSymbol as INamedTypeSymbol;
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
305parameterSymbol.ContainingSymbol is IMethodSymbol method &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
366if (method.IsReadOnly && (method.ContainingSymbol as INamedTypeSymbol)?.IsReadOnly != true)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (1)
81parameter.ContainingSymbol is IMethodSymbol methodSymbol &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2023enclosingSymbol = enclosingSymbol.ContainingSymbol;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (3)
CodeGen\CodeGenTupleTest.cs (3)
6228Assert.Same(comp.GlobalNamespace, ns.ContainingSymbol); 6236Assert.Same(comp.Assembly.GlobalNamespace, ns.ContainingSymbol); 6244Assert.Same(comp.SourceModule.GlobalNamespace, ns.ContainingSymbol);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (46)
FlowAnalysis\FlowTests.cs (1)
5842var property = declarations.Select(d => model.GetDeclaredSymbol(d)).Where(p => p.ContainingSymbol.Name == "Program").Single();
Semantics\PrimaryConstructorTests.cs (24)
965Assert.Equal("System.Int32 R.<I>k__BackingField", outVar.ContainingSymbol.ToTestDisplayString()); 1012Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 1078Assert.Equal("C..ctor(System.Int32 X, [System.Int32 Y = 123])", symbol.ContainingSymbol.ToTestDisplayString()); 1079Assert.Equal(Accessibility.Public, symbol.ContainingSymbol.DeclaredAccessibility); 1080Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 1306Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 1307Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 1319Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 1320Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 1330Assert.Equal("C", symbol.ContainingSymbol.ToTestDisplayString()); 1535Assert.Equal("C..ctor(System.Int32 X, System.Int32 Y)", symbol.ContainingSymbol.ToTestDisplayString()); 1536Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 1624Assert.Equal("C..ctor(System.Int32 X, System.Int32 Y)", symbol.ContainingSymbol.ToTestDisplayString()); 1625Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 1973Assert.Equal("C..ctor(System.Int32 X, System.Int32 Y)", symbol.ContainingSymbol.ToTestDisplayString()); 1974Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 2647Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 2685Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 2722Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 2758Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 7824Assert.Equal("C1", symbol.ContainingSymbol.ToTestDisplayString()); 7830Assert.Equal("C1..ctor(System.Int32 p1)", symbol.ContainingSymbol.ToTestDisplayString()); 8763Assert.Equal("C1..ctor(System.Int32 p1, System.Int32 p2, System.Int32 p3)", symbol.ContainingSymbol.ToTestDisplayString()); 9169Assert.Equal("C1..ctor(System.Int32 p1, System.Int32 p2)", symbol.ContainingSymbol.ToTestDisplayString());
Semantics\RecordTests.cs (21)
452Assert.Equal("R..ctor(R X)", parameter.ContainingSymbol.ToTestDisplayString()); 458Assert.Equal("R..ctor(R X)", initializer.ContainingSymbol.ToTestDisplayString()); 484Assert.Equal("System.Int32 R.<I>k__BackingField", outVar.ContainingSymbol.ToTestDisplayString()); 21195Assert.Equal("C..ctor(System.Int32 X, [System.Int32 Y = 123])", symbol.ContainingSymbol.ToTestDisplayString()); 21196Assert.Equal(Accessibility.Public, symbol.ContainingSymbol.DeclaredAccessibility); 21197Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 21425Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 21426Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 21438Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 21439Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 21449Assert.Equal("C", symbol.ContainingSymbol.ToTestDisplayString()); 21654Assert.Equal("C..ctor(System.Int32 X, System.Int32 Y)", symbol.ContainingSymbol.ToTestDisplayString()); 21655Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 21743Assert.Equal("C..ctor(System.Int32 X, System.Int32 Y)", symbol.ContainingSymbol.ToTestDisplayString()); 21744Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 22130Assert.Equal("C..ctor(System.Int32 X, System.Int32 Y)", symbol.ContainingSymbol.ToTestDisplayString()); 22131Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 24694Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 24729Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 24763Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 24798Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Features (6)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
285var containingSymbol = symbol.ContainingSymbol;
InlineHints\CSharpInlineTypeHintsService.cs (1)
78if (parameter?.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction } &&
LanguageServices\CSharpSymbolDisplayService.SymbolDescriptionBuilder.cs (1)
254if (symbol is IMethodSymbol method && method.ContainingSymbol.IsKind(SymbolKind.Method))
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
314var positionalParam = param.ContainingSymbol.ContainingType.GetMembers().FirstOrDefault(member
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
135typeToGenerateIn = symbolInfo.CandidateSymbols.FirstOrDefault().ContainingSymbol as INamedTypeSymbol;
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
305parameterSymbol.ContainingSymbol is IMethodSymbol method &&
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_IArgument.cs (1)
4161Assert.Same(indexerSymbol, argument.Parameter.ContainingSymbol);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (79)
Semantics\ExpressionBodiedMemberTests.cs (3)
209var accessor = Assert.IsType<SourcePropertyAccessorSymbol>(sym.ContainingSymbol.GetSymbol()); 262var m = semanticInfo.Symbol.ContainingSymbol.GetSymbol<SourceOrdinaryMethodSymbol>(); 266Assert.Equal(m, semanticInfo.Type.ContainingSymbol.GetSymbol());
Semantics\LocalFunctionTests.cs (10)
1721var localSymbol = model.GetDeclaredSymbol(x).ContainingSymbol.GetSymbol<LocalFunctionSymbol>(); 6451Assert.Equal("System.Object F2<T>()", symbol.ContainingSymbol.ToTestDisplayString()); 6492Assert.Equal("void C.M<T>()", symbol.ContainingSymbol.ToTestDisplayString()); 6495Assert.Equal("System.Object F2<T>()", symbol.ContainingSymbol.ToTestDisplayString()); 6498Assert.Equal("System.Object F3<U>()", symbol.ContainingSymbol.ToTestDisplayString()); 6539Assert.Equal("void C.M<T>()", symbol.ContainingSymbol.ToTestDisplayString()); 6542Assert.Equal("System.Object F2<T>()", symbol.ContainingSymbol.ToTestDisplayString()); 6545Assert.Equal("System.Object F3<U>()", symbol.ContainingSymbol.ToTestDisplayString()); 7667Assert.Equal(expectedContainer, symbol.ContainingSymbol.ToTestDisplayString()); 8700Assert.Equal(expectedMethod, symbol.ContainingSymbol.ToTestDisplayString());
Semantics\NativeIntegerTests.cs (3)
255Assert.Same(underlyingType.ContainingSymbol, nativeIntegerType.ContainingSymbol); 538Assert.Same(type, member.ContainingSymbol);
Semantics\NonTrailingNamedArgumentsTests.cs (2)
56Assert.Equal("void C.M(System.Int32 a, System.Int32 b)", firstASymbol.Symbol.ContainingSymbol.ToTestDisplayString()); 68Assert.Equal("void C.M(System.Int64 b, System.Int64 a)", secondASymbol.Symbol.ContainingSymbol.ToTestDisplayString());
Semantics\OperatorTests.cs (11)
7656Assert.Same(symbol1.ContainingSymbol, symbol1.Parameters[0].Type); 8408isChecked = isDynamic || symbol1.ContainingSymbol.Kind == SymbolKind.PointerType || symbol1.ContainingType.EnumUnderlyingTypeOrSelf().SpecialType.IsIntegralType(); 8431Assert.True(SymbolEqualityComparer.ConsiderEverything.Equals(symbol1.ContainingSymbol, symbol1.Parameters[0].Type) || 8432SymbolEqualityComparer.ConsiderEverything.Equals(symbol1.ContainingSymbol, symbol1.Parameters[1].Type)); 8435if (SymbolEqualityComparer.ConsiderEverything.Equals(symbol1.ContainingSymbol, symbol1.ReturnType)) 8440if (SymbolEqualityComparer.ConsiderEverything.Equals(symbol1.ContainingSymbol, symbol1.Parameters[0].Type)) 8445if (SymbolEqualityComparer.ConsiderEverything.Equals(symbol1.ContainingSymbol, symbol1.Parameters[1].Type)) 8643Assert.True(((ITypeSymbol)symbol1.ContainingSymbol).IsDynamic()); 8654Assert.True(((ITypeSymbol)symbol2.ContainingSymbol).IsDynamic()); 8693Assert.True(((ITypeSymbol)symbol1.ContainingSymbol).IsDynamic()); 8704Assert.True(((ITypeSymbol)symbol2.ContainingSymbol).IsDynamic());
Semantics\OverloadResolutionPerfTests.cs (1)
1061var containingTypes = exprs.SelectAsArray(e => model.GetSymbolInfo(e).Symbol.ContainingSymbol).ToTestDisplayStrings();
Semantics\RecordStructTests.cs (7)
2600Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 2635Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 2669Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 2704Assert.Equal("C..ctor(System.Int32 X)", symbol.ContainingSymbol.ToTestDisplayString()); 5853Assert.Equal("R..ctor(R X)", parameter.ContainingSymbol.ToTestDisplayString()); 5859Assert.Equal("R..ctor(R X)", initializer.ContainingSymbol.ToTestDisplayString()); 5895Assert.Equal("System.Int32 R.<I>k__BackingField", outVar.ContainingSymbol.ToTestDisplayString());
Semantics\TopLevelStatementsTests.cs (42)
237Assert.Same(declSymbol.ContainingSymbol, model1.GetDeclaredSymbol(unit1)); 238Assert.Same(declSymbol.ContainingSymbol, model1.GetDeclaredSymbol((SyntaxNode)unit1)); 361Assert.Same(declSymbol.ContainingSymbol, declMethod); 706Assert.Equal(SymbolKind.Method, local.ContainingSymbol.Kind); 707Assert.False(local.ContainingSymbol.IsImplicitlyDeclared); 708Assert.Equal(SymbolKind.NamedType, local.ContainingSymbol.ContainingSymbol.Kind); 709Assert.Equal("Program", local.ContainingSymbol.ContainingSymbol.Name); 710Assert.False(local.ContainingSymbol.ContainingSymbol.IsImplicitlyDeclared); 711Assert.True(((INamespaceSymbol)local.ContainingSymbol.ContainingSymbol.ContainingSymbol).IsGlobalNamespace); 3959Assert.Equal("<top-level-statements-entry-point>", parameter.ContainingSymbol.ToTestDisplayString()); 4223Assert.Equal(SymbolKind.Method, local.ContainingSymbol.Kind); 4224Assert.False(local.ContainingSymbol.IsImplicitlyDeclared); 4225Assert.Equal(SymbolKind.NamedType, local.ContainingSymbol.ContainingSymbol.Kind); 4226Assert.False(local.ContainingSymbol.ContainingSymbol.IsImplicitlyDeclared); 4227Assert.True(((INamespaceSymbol)local.ContainingSymbol.ContainingSymbol.ContainingSymbol).IsGlobalNamespace); 4901Assert.Equal(SymbolKind.Method, label.ContainingSymbol.Kind); 4902Assert.False(label.ContainingSymbol.IsImplicitlyDeclared); 4903Assert.Equal(SymbolKind.NamedType, label.ContainingSymbol.ContainingSymbol.Kind); 4904Assert.False(label.ContainingSymbol.ContainingSymbol.IsImplicitlyDeclared); 4905Assert.True(((INamespaceSymbol)label.ContainingSymbol.ContainingSymbol.ContainingSymbol).IsGlobalNamespace); 4986Assert.Equal(SymbolKind.Method, label.ContainingSymbol.Kind); 4987Assert.False(label.ContainingSymbol.IsImplicitlyDeclared); 4988Assert.Equal(SymbolKind.NamedType, label.ContainingSymbol.ContainingSymbol.Kind); 4989Assert.False(label.ContainingSymbol.ContainingSymbol.IsImplicitlyDeclared); 4990Assert.True(((INamespaceSymbol)label.ContainingSymbol.ContainingSymbol.ContainingSymbol).IsGlobalNamespace);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (79)
Compilation\GetSemanticInfoTests.cs (8)
1172Assert.Equal(MethodKind.EventAdd, ((IMethodSymbol)parameterSymbol.ContainingSymbol).MethodKind); 1201Assert.Equal(MethodKind.EventRemove, ((IMethodSymbol)parameterSymbol.ContainingSymbol).MethodKind); 1614Assert.Equal(comp.GlobalNamespace.GetMember<INamedTypeSymbol>("A"), symbol.ContainingSymbol); //from the type, not the method 1710Assert.Equal(SymbolKind.Method, symbol.ContainingSymbol.Kind); 1745Assert.Equal(SymbolKind.Method, symbol.ContainingSymbol.Kind); 1780Assert.Equal(SymbolKind.Method, symbol.ContainingSymbol.Kind); 2360Assert.Equal(MethodKind.AnonymousFunction, ((IMethodSymbol)parameterSymbol.ContainingSymbol).MethodKind); 2542Assert.Equal(MethodKind.Conversion, ((IMethodSymbol)symbol.ContainingSymbol).MethodKind);
Compilation\GetUnusedImportDirectivesTests.cs (2)
199Assert.Equal(SymbolKind.Namespace, info.Symbol.ContainingSymbol.Kind); 200Assert.Equal("System", info.Symbol.ContainingSymbol.Name);
Compilation\SemanticModelAPITests.cs (6)
358Assert.Equal(symbol1.ContainingSymbol, symbol2.ContainingSymbol); 381Assert.NotEqual(symbol1.ContainingSymbol, symbol2.ContainingSymbol); 4604Assert.Equal("<global namespace>", alias1.ContainingSymbol.ToTestDisplayString()); 4630Assert.Equal("<global namespace>", alias1.ContainingSymbol.ToTestDisplayString());
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (8)
952Assert.Equal<ISymbol>(structSymbol, fSymbol.ContainingSymbol); 3242Assert.Equal(compilation.Assembly.GlobalNamespace, info.Type.ContainingSymbol); //error type resides in global namespace 5225Assert.Same(symbol1.ContainingSymbol, symbol2.ContainingSymbol); 5246Assert.Same(symbol1.ContainingSymbol, symbol2.ContainingSymbol); 5267Assert.Same(symbol1.ContainingSymbol, symbol2.ContainingSymbol);
Compilation\SemanticModelGetSemanticInfoTests.cs (10)
4385Assert.Equal(SymbolKind.Namespace, semanticInfo.Type.ContainingSymbol.Kind); 4386Assert.True(((INamespaceSymbol)semanticInfo.Type.ContainingSymbol).IsGlobalNamespace); 4548Assert.True(symbol.ContainingSymbol.Kind == SymbolKind.Property && ((IPropertySymbol)symbol.ContainingSymbol).IsIndexer); 4886Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol.ContainingSymbol).MethodKind); 4892Assert.Equal(SymbolKind.Method, semanticInfo.Symbol.ContainingSymbol.Kind); 4893Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol.ContainingSymbol).MethodKind); 9273Assert.Equal(constructedFrom, constructedFrom.TypeParameters[0].ContainingSymbol); 9275Assert.Equal(type.ContainingSymbol, constructedFrom.ContainingSymbol);
Symbols\AssemblyAndNamespaceTests.cs (2)
46Assert.Null(sym.ContainingSymbol); 72Assert.Equal("Test", sym.ContainingSymbol.Name);
Symbols\LocalFunctionTests.cs (6)
449Assert.Equal("void C.M()", symbol.ContainingSymbol.ToTestDisplayString()); 473Assert.Equal("void C.M()", symbol.ContainingSymbol.ToTestDisplayString()); 502Assert.Equal("void outer<T3>()", symbol.ContainingSymbol.ToTestDisplayString()); 503Assert.Equal("void C<T1>.M<T2>()", symbol.ContainingSymbol.ContainingSymbol.ToTestDisplayString()); 525Assert.Equal("C<System.Int32>", symbol.ContainingSymbol.ToTestDisplayString());
Symbols\Metadata\PE\HasUnsupportedMetadata.cs (2)
164Assert.False(c3.ContainingSymbol.HasUnsupportedMetadata); 368Assert.False(c3.ContainingSymbol.HasUnsupportedMetadata);
Symbols\Source\NullablePublicAPITests.cs (21)
3509Assert.Equal(mSymbol, lambdaSymbol.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3547Assert.Equal(lambdaSymbol, innerLambdaSymbol.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3570Assert.Equal(innerLambdaSymbol, o2Symbol.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3608Assert.Equal(lambdaSymbol, innerLambdaSymbol.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3631Assert.Equal(innerLambdaSymbol, o2Symbol.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3670Assert.Equal(lambdaSymbol, localFunctionSymbol.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3671Assert.Equal(localFunctionSymbol, o2Symbol.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3812Assert.Equal(lambdaSymbol, paramSymbol.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3880Assert.Equal(localFunctionSymbol, model.GetDeclaredSymbol(o8Declaration).ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3884Assert.Equal(lambdaSymbol, model.GetDeclaredSymbol(node).ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3924Assert.Equal(fieldLambdaSymbol, o1Symbol.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3925Assert.Equal(fieldLambdaSymbol, o2Symbol.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3938Assert.Equal(propertyLambdaSymbol, o3Symbol.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3939Assert.Equal(propertyLambdaSymbol, o4Symbol.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3983Assert.Equal(lambdaSymbol, innerLambdaSymbol1.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 3993Assert.Equal(lambdaSymbol, innerLambdaSymbol1.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 4126Assert.Equal(lambdaSymbol, o2Result.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 4127Assert.Equal(localFunctionSymbol, o8Result.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 4131Assert.Equal(lambdaSymbol, o1Result.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 4132Assert.Equal(localFunctionSymbol, oResult.ContainingSymbol, SymbolEqualityComparer.IncludeNullability); 4184Assert.Same(localFunctionSymbol, typeParameters.ContainingSymbol);
Symbols\Source\UsingAliasTests.cs (2)
392var global = (INamespaceSymbol)alias.ContainingSymbol; 413var global = (INamespaceSymbol)alias.ContainingSymbol;
Symbols\TypeTests.cs (4)
469Assert.Equal(classTest, field1.ContainingSymbol); 484Assert.Equal(classTest, field1.ContainingSymbol); 640Assert.Equal(a, obj.ContainingSymbol); 648Assert.Equal(a, dyn.ContainingSymbol);
Symbols\UnsignedRightShiftTests.cs (8)
137Assert.Same(shiftSymbol.ContainingSymbol, unsignedShiftSymbol.ContainingSymbol); 640Assert.Same(shiftSymbol.ContainingSymbol, unsignedShiftSymbol.ContainingSymbol); 1190Assert.Same(shiftSymbol.ContainingSymbol, unsignedShiftSymbol.ContainingSymbol); 1598Assert.Same(shiftSymbol.ContainingSymbol, unsignedShiftSymbol.ContainingSymbol);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
165Assert.Equal<ISymbol>(typeParameter.ContainingSymbol, constructedFrom);
Microsoft.CodeAnalysis.CSharp.Workspaces (12)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (1)
159symbol is IParameterSymbol { ContainingSymbol: IMethodSymbol { Name: WellKnownMemberNames.TopLevelStatementsEntryPointMethodName } })
Recommendations\CSharpRecommendationServiceRunner.cs (1)
392if (context.ContainingTypeDeclaration != null && symbol.ContainingSymbol.Name == WellKnownMemberNames.TopLevelStatementsEntryPointMethodName)
Rename\CSharpRenameRewriterLanguageService.cs (3)
361symbol = symbol.ContainingSymbol; 802if (renamedSymbol.ContainingSymbol is INamedTypeSymbol { TypeKind: not TypeKind.Enum } containingNamedType && 822renamedSymbol.ContainingSymbol is IMethodSymbol methodSymbol &&
Simplification\CSharpSimplificationService.Expander.cs (3)
560if (symbol.ContainingSymbol.Equals(symbol.OriginalDefinition.ContainingSymbol) && 862TypeArgumentsInAllContainingSymbol(symbol.ContainingSymbol, typeArgumentSymbols, enterContainingSymbol, isRecursive);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
325ContainingSymbol: INamespaceSymbol { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
366if (method.IsReadOnly && (method.ContainingSymbol as INamedTypeSymbol)?.IsReadOnly != true)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (1)
81parameter.ContainingSymbol is IMethodSymbol methodSymbol &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2023enclosingSymbol = enclosingSymbol.ContainingSymbol;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (10)
Utilities\SymbolEquivalenceComparerTests.cs (10)
889Assert.True(SymbolEquivalenceComparer.Instance.Equals(outer1, inner1.ContainingSymbol)); 891SymbolEquivalenceComparer.Instance.GetHashCode(inner1.ContainingSymbol)); 893Assert.True(SymbolEquivalenceComparer.Instance.Equals(outer1, innerType1.ContainingSymbol.ContainingSymbol)); 895SymbolEquivalenceComparer.Instance.GetHashCode(innerType1.ContainingSymbol.ContainingSymbol)); 897Assert.True(SymbolEquivalenceComparer.Instance.Equals(inner1, innerType1.ContainingSymbol)); 899SymbolEquivalenceComparer.Instance.GetHashCode(innerType1.ContainingSymbol)); 901Assert.True(SymbolEquivalenceComparer.Instance.Equals(outer1, outerType1.ContainingSymbol)); 903SymbolEquivalenceComparer.Instance.GetHashCode(outerType1.ContainingSymbol));
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (7)
AbstractTypeParameterChecker.cs (7)
35string.Format("Unexpected type parameter {0} owned by {1}", symbol, symbol.ContainingSymbol)); 70Visit(symbol.ContainingSymbol); 77Visit(symbol.ContainingSymbol); 84Visit(symbol.ContainingSymbol); 106Visit(symbol.ContainingSymbol); 118Visit(symbol.ContainingSymbol); 128Visit(symbol.ContainingSymbol);
Microsoft.CodeAnalysis.Features (42)
CodeLens\CodeLensReferencesService.cs (1)
221for (var current = enclosingSymbol; current != null; current = current.ContainingSymbol)
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (1)
90if (declaredSymbol.ContainingSymbol is not INamespaceOrTypeSymbol containingSymbol)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
308GetDisplayKind(symbol.ContainingSymbol), 309symbol.ContainingSymbol.ToDisplayString(format))
EditAndContinue\Utilities\Extensions.cs (2)
164=> parameter.IsImplicitlyDeclared || parameter.ContainingSymbol.IsSynthesized() && parameter.ContainingSymbol != parameter.ContainingType.DelegateInvokeMethod;
ExtractMethod\MethodExtractor.Analyzer.cs (3)
793parameter.ContainingSymbol != null && 794parameter.ContainingSymbol.ContainingType != null && 795parameter.ContainingSymbol.ContainingType.IsScriptClass;
ExtractMethod\MethodExtractor.VariableSymbol.cs (2)
139var compare = CompareMethodParameters((IMethodSymbol)_parameterSymbol.ContainingSymbol, (IMethodSymbol)other._parameterSymbol.ContainingSymbol);
FullyQualify\AbstractFullyQualifyService.cs (2)
268=> symbol.ContainingSymbol is INamespaceSymbol or INamedTypeSymbol { IsGenericType: false }; 298var containingSymbol = symbolResult.Symbol.ContainingSymbol as INamespaceOrTypeSymbol;
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (2)
348if (memberSymbol.ContainingSymbol.IsInterfaceType()) 622&& memberSymbol.ContainingSymbol.IsInterfaceType())
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (3)
162document = await AddStringCheckAsync(document, parameter, functionDeclaration, (IMethodSymbol)parameter.ContainingSymbol, blockStatementOpt, nameof(string.IsNullOrEmpty), lazySimplifierOptions, cancellationToken).ConfigureAwait(false); 168(IMethodSymbol)parameter.ContainingSymbol, blockStatementOpt, lazySimplifierOptions, cancellationToken).ConfigureAwait(false); 416var methodSymbol = (IMethodSymbol)parameter.ContainingSymbol;
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (1)
79if (parameter.ContainingSymbol is not IMethodSymbol methodSymbol ||
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
232if (parameter is not { ContainingSymbol: IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction } method })
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
79if (expressionSymbol is IParameterSymbol parameterSymbol && parameterSymbol.ContainingSymbol.Equals(containingSymbol))
LanguageServiceIndexFormat\SymbolMoniker.cs (1)
62symbolMoniker += GetRequiredDocumentationCommentId(symbol.ContainingSymbol) + "#" + symbol.Name;
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
699ToMinimalDisplayParts(symbol.ContainingSymbol, s_typeParameterOwnerFormat));
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
37public ISymbol ContainingSymbol => _symbol.ContainingSymbol;
MetadataAsSource\MetadataAsSourceHelpers.cs (2)
58while (topLevelNamedType.ContainingSymbol != symbol.ContainingNamespace || 61topLevelNamedType = topLevelNamedType.ContainingSymbol;
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
121var symbolToFind = symbol is IParameterSymbol parameterSymbol ? parameterSymbol.ContainingSymbol : symbol;
Shared\Extensions\ISymbolExtensions_2.cs (4)
197ITypeParameterSymbol typeParam => typeParam.ContainingSymbol.GetDocumentationComment(compilation, expandIncludes: true, expandInheritdoc: true, cancellationToken: cancellationToken)?.GetTypeParameter(typeParam.Name) ?? DocumentationComment.Empty, 206var containingSymbol = parameter.ContainingSymbol; 207if (containingSymbol.ContainingSymbol.IsDelegateType() && containingSymbol is IMethodSymbol methodSymbol) 224containingSymbol = containingSymbol.ContainingSymbol;
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
537unusedParameter.ContainingSymbol.IsLocalFunction())
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (4)
135!ShouldReportUnusedParameters(parameter.ContainingSymbol, option.Value, option.Notification.Severity)) 143isPublicApiParameter: parameter.ContainingSymbol.HasPublicResultantVisibility(), 144isLocalFunctionParameter: parameter.ContainingSymbol.IsLocalFunction()); 206parameter.ContainingSymbol is not IMethodSymbol method ||
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
194if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.Constructor, DeclaringSyntaxReferences: [var reference] } constructor)
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
114for (ISymbol current = symbol; current != null; current = current.ContainingSymbol)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
401symbol = symbol.ContainingSymbol;
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
801var parameterType = BindParameterOrReturnType(symbol.ContainingSymbol, parameterInfo.Type);
ValueTracking\ValueTracker.cs (2)
108var isParameterForPreviousTrackedMethod = previousSymbol?.Equals(parameterSymbol.ContainingSymbol, SymbolEqualityComparer.Default) == true; 179var containingSymbol = parameterSymbol.ContainingSymbol;
Microsoft.CodeAnalysis.Test.Utilities (8)
Compilation\CompilationExtensions.cs (1)
383if ((parameterInitializerOperation.Parameter.ContainingSymbol as IMethodSymbol)?.MethodKind is not (MethodKind.LocalFunction or MethodKind.AnonymousFunction))
Compilation\ControlFlowGraphVerifier.cs (6)
1704if (localReference.Local.ContainingSymbol.IsTopLevelMainMethod() && !isInAssociatedSymbol(localReference.Local.ContainingSymbol, associatedSymbol)) 1718if (method.ContainingSymbol.IsTopLevelMainMethod() && !isInAssociatedSymbol(method.ContainingSymbol, associatedSymbol)) 1733if (method.ContainingSymbol.IsTopLevelMainMethod() && !associatedSymbol.IsTopLevelMainMethod()) 1762symbol = m.ContainingSymbol;
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
2082symbol = symbol.ContainingSymbol;
Microsoft.CodeAnalysis.VisualBasic (7)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (5)
13Debug.Assert(TypeOf symbol.ContainingSymbol Is INamedTypeSymbol) 21Dim containingType = TryCast(symbol.ContainingSymbol, INamedTypeSymbol) 300containingType = TryCast(symbol.ContainingSymbol, INamedTypeSymbol) 613Dim containingType = TryCast(symbol.ContainingSymbol, INamedTypeSymbol) 699symbol.ContainingSymbol IsNot Nothing OrElse
SymbolDisplay\SymbolDisplayVisitor.Types.vb (1)
139Dim containingSymbol As ISymbol = symbol.ContainingSymbol
Symbols\Symbol.vb (1)
1211Private ReadOnly Property ISymbol_ContainingSymbol As ISymbol Implements ISymbol.ContainingSymbol
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (3)
CodeGen\CodeGenTuples.vb (3)
8952Assert.Same(comp.GlobalNamespace, ns.ContainingSymbol) 8960Assert.Same(comp.Assembly.GlobalNamespace, ns.ContainingSymbol) 8968Assert.Same(comp.SourceModule.GlobalNamespace, ns.ContainingSymbol)
Microsoft.CodeAnalysis.VisualBasic.Features (3)
Completion\CompletionProviders\ImplementsClauseCompletionProvider.vb (1)
233Dim containingSymbol = symbol.ContainingSymbol
InlineHints\VisualBasicInlineParameterNameHintsService.vb (1)
95Dim propertySymbol = TryCast(parameter.ContainingSymbol, IPropertySymbol)
LanguageServices\VisualBasicSymbolDisplayService.SymbolDescriptionBuilder.vb (1)
170If method IsNot Nothing AndAlso method.ContainingSymbol.IsKind(SymbolKind.Method) Then
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (14)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (13)
1103Assert.Equal(parameterSymbol.ContainingSymbol, propertySymbol) 1107Assert.Equal(parameterSymbol.ContainingSymbol, propertySymbol.SetMethod) 1256Assert.Equal("Sub Goo.Bar.N1.C1.Goo(x As System.Int32, [yopt As System.String = ""hi""])", paramSymbol1.ContainingSymbol.ToTestDisplayString()) 1264Assert.Equal("Sub Goo.Bar.N1.C1.Goo(x As System.Int32, [yopt As System.String = ""hi""])", paramSymbol2.ContainingSymbol.ToTestDisplayString()) 1272Assert.Equal("Function Goo.Bar.N1.C1.Goo(a As System.Int64, a As System.Int32) As System.String", paramSymbol3.ContainingSymbol.ToTestDisplayString()) 1280Assert.Equal("Function Goo.Bar.N1.C1.Goo(a As System.Int64, a As System.Int32) As System.String", paramSymbol4.ContainingSymbol.ToTestDisplayString()) 1288Assert.Equal("Sub Goo.Bar.N1.C1..ctor(c As System.String, d As System.String)", paramSymbol5.ContainingSymbol.ToTestDisplayString()) 1323Assert.Equal("Sub N1.Test.PercentEventHandler.Invoke(Percent As System.Single)", paramSymbol1.ContainingSymbol.ToTestDisplayString()) 1847Assert.Equal("Goo.Bar.N1.C1(Of TTT, UUU)", tpSymbol1.ContainingSymbol.ToTestDisplayString()) 1856Assert.Equal("Goo.Bar.N1.C1(Of TTT, UUU)", tpSymbol2.ContainingSymbol.ToTestDisplayString()) 1865Assert.Equal("Goo.Bar.N1.C1(Of TTT, UUU)", tpSymbol3.ContainingSymbol.ToTestDisplayString()) 1874Assert.Equal("Goo.Bar.N1.C1(Of TTT, UUU)", tpSymbol4.ContainingSymbol.ToTestDisplayString()) 1883Assert.Equal("Sub Goo.Bar.N1.C1(Of TTT, UUU).K(Of VVV)(a As VVV)", tpSymbol5.ContainingSymbol.ToTestDisplayString())
Semantics\UsingStatementTest.vb (1)
348Assert.Equal(symbols(i), type.Symbol.ContainingSymbol)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (10)
Rename\VisualBasicRenameRewriterLanguageService.vb (7)
313symbol = symbol.ContainingSymbol 718renamedSymbol.ContainingSymbol.Kind = SymbolKind.Method Then 719Dim methodSymbol = DirectCast(renamedSymbol.ContainingSymbol, IMethodSymbol) 740renamedSymbol.ContainingSymbol.Kind = SymbolKind.Property AndAlso 741CaseInsensitiveComparison.Equals(renamedSymbol.ContainingSymbol.Name, renamedSymbol.Name) Then 743Dim propertySymbol = renamedSymbol.ContainingSymbol 746conflicts.AddRange(renamedSymbol.ContainingSymbol.Locations _
Simplification\VisualBasicSimplificationService.Expander.vb (3)
419symbolForQualifiedName = symbolForQualifiedName.ContainingSymbol 719Dim symbolForQualification = If(replaceNode, symbol, symbol.ContainingSymbol) 733displayParts = symbolForQualification.ContainingSymbol.ToDisplayParts(typeNameFormatWithGenerics)
Microsoft.CodeAnalysis.Workspaces (99)
Editing\SyntaxGenerator.cs (1)
329isExtension: symbol is { Ordinal: 0, ContainingSymbol: IMethodSymbol { IsExtensionMethod: true } },
FindSymbols\Declarations\DeclarationFinder_SourceDeclarations.cs (1)
255var container = symbol.ContainingSymbol;
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (1)
74for (var current = symbol; current != null; current = current.ContainingSymbol)
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (1)
789var containingSymbol = definition.ContainingSymbol;
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (1)
25var method = (IMethodSymbol)symbol.ContainingSymbol;
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (12)
76if (parameter.ContainingSymbol is IMethodSymbol { AssociatedAnonymousDelegate.DelegateInvokeMethod: { } invokeMethod } && 95if (parameter.ContainingSymbol.IsAnonymousFunction()) 108var lambdaNode = parameter.ContainingSymbol.DeclaringSyntaxReferences.Select(r => r.GetSyntax(cancellationToken)).First(); 144symbol.ContainingSymbol.IsAnonymousFunction() && 145SignatureComparer.Instance.HaveSameSignatureAndConstraintsAndReturnTypeAndAccessors(parameter.ContainingSymbol, symbol.ContainingSymbol, syntaxFacts.IsCaseSensitive) && 146ParameterNamesMatch(syntaxFacts, (IMethodSymbol)parameter.ContainingSymbol, (IMethodSymbol)symbol.ContainingSymbol)) 148var lambdaNode = symbol.ContainingSymbol.DeclaringSyntaxReferences.Select(r => r.GetSyntax(cancellationToken)).First(); 187var containingSymbol = parameter.ContainingSymbol; 208if (parameter.ContainingSymbol is IMethodSymbol containingMethod) 245if (parameter.ContainingSymbol is IMethodSymbol method)
FindSymbols\ReferenceLocationExtensions.cs (1)
75for (var current = enclosingSymbol; current != null; current = current.ContainingSymbol)
ReassignedVariable\AbstractReassignedVariableService.cs (4)
181var methodOrProperty = parameter.ContainingSymbol; 254else if (parameter.ContainingSymbol.Name == WellKnownMemberNames.TopLevelStatementsEntryPointMethodName) 363if (localOrParameter is IParameterSymbol { ContainingSymbol: IPropertySymbol property } parameter) 386if (localOrParameter is IParameterSymbol { ContainingSymbol: IPropertySymbol property } parameter)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
68if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.AnonymousFunction } owningMethod)
Rename\ConflictEngine\ConflictResolver.cs (5)
239if (renamedSymbol.ContainingSymbol.IsKind(SymbolKind.NamedType)) 265if (renamedSymbol.IsKind(SymbolKind.Namespace) && renamedSymbol.ContainingSymbol.IsKind(SymbolKind.Namespace)) 267var otherThingsNamedTheSame = ((INamespaceSymbol)renamedSymbol.ContainingSymbol).GetMembers(renamedSymbol.Name) 275if (renamedSymbol.IsKind(SymbolKind.NamedType) && renamedSymbol.ContainingSymbol is INamespaceOrTypeSymbol) 277var otherThingsNamedTheSame = ((INamespaceOrTypeSymbol)renamedSymbol.ContainingSymbol).GetMembers(renamedSymbol.Name)
Rename\RenameUtilities.cs (2)
332if (symbol.ContainingSymbol.Kind == SymbolKind.Method) 334var containingMethod = (IMethodSymbol)symbol.ContainingSymbol;
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (3)
105if (referencedSymbol.ContainingSymbol != null && 106referencedSymbol.ContainingSymbol.Kind == SymbolKind.NamedType && 107((INamedTypeSymbol)referencedSymbol.ContainingSymbol).TypeKind == TypeKind.Interface &&
Shared\Extensions\ISymbolExtensions_2.cs (1)
15if (symbol.ContainingSymbol is IMethodSymbol method)
Shared\Extensions\SemanticModelExtensions.cs (1)
36symbol.ContainingSymbol is IMethodSymbol method)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (2)
45return symbol.ContainingSymbol != null && IsGeneratedSymbolWithGeneratedCodeAttribute(symbol.ContainingSymbol, generatedCodeAttribute);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (2)
28ContainingSymbol: IMethodSymbol 60ContainingSymbol: IMethodSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (4)
43return GetResultantVisibility(symbol.ContainingSymbol); 70symbol = symbol.ContainingSymbol; 373if (symbol.ContainingSymbol is IMethodSymbol method) 391var method = parameter.ContainingSymbol as IMethodSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (2)
155if (symbol.ContainingSymbol.IsKind(SymbolKind.DynamicType)) 161if (symbol.ContainingSymbol is IPointerTypeSymbol pointerType)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
70symbol = symbol.ContainingSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
160for (var currentSymbol = symbol; currentSymbol != null; currentSymbol = currentSymbol.ContainingSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (1)
70var container = symbol.ContainingSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (5)
43/// the "same" <see cref="ISymbol.ContainingSymbol"/>, 48/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 54/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 64/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 67/// the "same" <see cref="ISymbol.ContainingSymbol"/> and
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ErrorTypeSymbolKey.cs (1)
20switch (symbol.ContainingSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (2)
133visitor.WriteSymbolKey(symbol.ContainingSymbol); 165var containingType = reader.ReadSymbolKey(contextualSymbol?.ContainingSymbol, out var containingTypeFailureReason);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (2)
16=> visitor.WriteSymbolKey(symbol.ContainingSymbol); 21var containingSymbolResolution = reader.ReadSymbolKey(contextualSymbol?.ContainingSymbol, out var containingSymbolFailureReason);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (3)
19visitor.WriteSymbolKey(symbol.ContainingSymbol); 42var containingSymbolResolution = reader.ReadSymbolKey(contextualSymbol?.ContainingSymbol, out var containingSymbolFailureReason); 124if (containingSymbolResolution.SymbolCount == 0 && errorType.ContainingSymbol is INamespaceSymbol containingNamespace)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ParameterSymbolKey.cs (2)
20visitor.WriteSymbolKey(symbol.ContainingSymbol); 33contextualSymbol?.ContainingSymbol, out var containingSymbolFailureReason);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PropertySymbolKey.cs (2)
18visitor.WriteSymbolKey(symbol.ContainingSymbol); 30var containingTypeResolution = reader.ReadSymbolKey(contextualSymbol?.ContainingSymbol, out var containingTypeFailureReason);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterSymbolKey.cs (2)
26visitor.WriteSymbolKey(symbol.ContainingSymbol); 52var containingSymbolResolution = reader.ReadSymbolKey(contextualSymbol?.ContainingSymbol, out var containingSymbolFailureReason);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (2)
469parameterSymbol.ContainingSymbol.IsAnonymousOrLocalFunction() && 470newParameterSymbol.ContainingSymbol.IsAnonymousOrLocalFunction())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (18)
156AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies); 217if (!AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies)) 368x.ContainingSymbol is INamespaceSymbol xNamespace && 369y.ContainingSymbol is INamespaceSymbol yNamespace) 390if (!AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies)) 561return AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies); 571AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies); 605AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies); 612AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies); 652return AreEquivalent(x.ContainingSymbol, y.ContainingSymbol, equivalentTypesWithDifferingAssemblies);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (8)
93GetHashCode(x.ContainingSymbol, currentHash)); 129currentHash = GetHashCode(x.ContainingSymbol, currentHash); 178GetHashCode(x.ContainingSymbol, currentHash)))))))); 220GetHashCode(x.ContainingSymbol, currentHash))); 229GetHashCode(x.ContainingSymbol, currentHash)))); 247GetHashCode(x.ContainingSymbol, currentHash)))))); 256GetHashCode(x.ContainingSymbol, currentHash)); 288GetHashCode(x.ContainingSymbol, currentHash);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (2)
49var containingSymbol = type.ContainingSymbol; 52((INamespaceSymbol)containingSymbol.ContainingSymbol).IsGlobalNamespace)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\InitializeParameterHelpersCore.cs (1)
20if (parameter.ContainingSymbol is IMethodSymbol method)
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (1)
125symbol = symbol.ContainingSymbol;
Microsoft.Extensions.Logging.Generators (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
108return GetResultantVisibility(symbol.ContainingSymbol); 135symbol = symbol.ContainingSymbol;
Microsoft.Extensions.Options.SourceGeneration (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
108return GetResultantVisibility(symbol.ContainingSymbol); 135symbol = symbol.ContainingSymbol;
Microsoft.Gen.Logging (4)
Parsing\Parser.cs (1)
551Diag(DiagDescriptors.LoggingMethodParameterRefKind, paramSymbol.GetLocation(), paramSymbol.ContainingSymbol.Name, paramName);
Parsing\Parser.TagProvider.cs (1)
194symbol = symbol.ContainingSymbol;
src\Generators\Shared\RoslynExtensions.cs (2)
157return GetResultantVisibility(symbol.ContainingSymbol); 184symbol = symbol.ContainingSymbol;
Microsoft.Gen.Metrics (3)
Parser.cs (1)
878throw new TransitiveTypeCycleException(parentSymbol.ContainingSymbol, namedTypeSymbol); // Interrupt the whole traversal
src\Generators\Shared\RoslynExtensions.cs (2)
157return GetResultantVisibility(symbol.ContainingSymbol); 184symbol = symbol.ContainingSymbol;
Microsoft.Gen.MetricsReports (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
878throw new TransitiveTypeCycleException(parentSymbol.ContainingSymbol, namedTypeSymbol); // Interrupt the whole traversal
Microsoft.Interop.ComInterfaceGenerator (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
108return GetResultantVisibility(symbol.ContainingSymbol); 135symbol = symbol.ContainingSymbol;
Microsoft.Interop.LibraryImportGenerator (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
108return GetResultantVisibility(symbol.ContainingSymbol); 135symbol = symbol.ContainingSymbol;
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
108return GetResultantVisibility(symbol.ContainingSymbol); 135symbol = symbol.ContainingSymbol;
Microsoft.Interop.SourceGeneration (4)
ISymbolExtensions.cs (2)
23for (ISymbol current = symbol.ContainingSymbol; current is INamedTypeSymbol currentType; current = currentType.ContainingSymbol)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
108return GetResultantVisibility(symbol.ContainingSymbol); 135symbol = symbol.ContainingSymbol;
Microsoft.ML.InternalCodeAnalyzer (1)
ContractsCheckAnalyzer.cs (1)
198var containingSymbolName = methodSymbol.ContainingSymbol.ToString();
Microsoft.VisualStudio.LanguageServices (12)
Progression\GraphBuilder.cs (3)
388node.Label = CodeQualifiedIdentifierBuilder.SpecialNames.GetConstructorLabel(methodSymbol.ContainingSymbol.Name); 392node.Label = CodeQualifiedIdentifierBuilder.SpecialNames.GetStaticConstructorLabel(methodSymbol.ContainingSymbol.Name); 396node.Label = CodeQualifiedIdentifierBuilder.SpecialNames.GetFinalizerLabel(methodSymbol.ContainingSymbol.Name);
Progression\GraphNodeIdCreation.cs (9)
461if (symbol.ContainingSymbol == null || 462(symbol.ContainingSymbol.Kind != SymbolKind.Method && symbol.ContainingSymbol.Kind != SymbolKind.Property)) 468var containingSymbol = symbol.ContainingSymbol; 489if (symbol.ContainingSymbol == null || 490(symbol.ContainingSymbol.Kind != SymbolKind.Method && symbol.ContainingSymbol.Kind != SymbolKind.Property)) 496var memberId = await GetIdForMemberAsync(symbol.ContainingSymbol, solution, cancellationToken).ConfigureAwait(false); 521foreach (var reference in symbol.ContainingSymbol.DeclaringSyntaxReferences)
Microsoft.VisualStudio.LanguageServices.CSharp (13)
CodeModel\CSharpCodeModelService_Prototype.cs (11)
324AppendTypeNamePrototype(builder, includeNamespaces: true, includeGenerics: false, symbol: symbol.ContainingSymbol); 329AppendTypeNamePrototype(builder, includeNamespaces: true, includeGenerics: true, symbol: symbol.ContainingSymbol); 372AppendTypeNamePrototype(builder, includeNamespaces: true, includeGenerics: false, symbol: symbol.ContainingSymbol); 377AppendTypeNamePrototype(builder, includeNamespaces: false, includeGenerics: true, symbol: symbol.ContainingSymbol); 404AppendTypeNamePrototype(builder, includeNamespaces: true, includeGenerics: false, symbol: symbol.ContainingSymbol); 409AppendTypeNamePrototype(builder, includeNamespaces: false, includeGenerics: true, symbol: symbol.ContainingSymbol); 452AppendTypeNamePrototype(builder, includeNamespaces: true, includeGenerics: false, symbol: symbol.ContainingSymbol); 457AppendTypeNamePrototype(builder, includeNamespaces: false, includeGenerics: true, symbol: symbol.ContainingSymbol); 492AppendTypeNamePrototype(builder, includeNamespaces: true, includeGenerics: false, symbol: symbol.ContainingSymbol); 497AppendTypeNamePrototype(builder, includeNamespaces: false, includeGenerics: true, symbol: symbol.ContainingSymbol); 572symbol = symbol.ContainingSymbol;
Progression\CSharpProgressionLanguageService.cs (2)
105if (includeContainingSymbol && symbol.ContainingSymbol != null) 107label += " (" + symbol.ContainingSymbol.ToDisplayString(s_labelFormat) + ")";
Microsoft.VisualStudio.LanguageServices.VisualBasic (3)
CodeModel\MethodXML\MethodXmlBuilder.vb (1)
343Return symbol.ContainingSymbol.ToDisplayString(s_fullNameFormat) & "." & symbol.Name
Progression\VisualBasicProgressionLanguageService.vb (2)
88If includeContainingSymbol AndAlso symbol.ContainingSymbol IsNot Nothing Then 89label += " (" + symbol.ContainingSymbol.ToDisplayString(displayFormat) + ")"
System.Private.CoreLib.Generators (7)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (7)
203return symbolInfo.Symbol.ContainingSymbol as INamedTypeSymbol; 216return symbolInfo.Symbol.ContainingSymbol as INamedTypeSymbol; 283var typeSymbol = symbolInfo.Symbol.ContainingSymbol as INamedTypeSymbol; 406if (symbolOfInvokeTarget.ContainingSymbol.Equals(symbol, SymbolEqualityComparer.Default)) 462if (onLoadData.NamedTypesToBeProtected.Contains(symbol.ContainingSymbol)) 470(methodSymbol.ContainingType.Equals(symbol.ContainingSymbol, SymbolEqualityComparer.Default) 686context.ReportDiagnostic(Diagnostic.Create(Rule, operation.Syntax.GetLocation(), symbol.ContainingSymbol.ToDisplayString()));
System.Text.Json.SourceGeneration (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
108return GetResultantVisibility(symbol.ContainingSymbol); 135symbol = symbol.ContainingSymbol;
System.Text.RegularExpressions.Generator (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (2)
108return GetResultantVisibility(symbol.ContainingSymbol); 135symbol = symbol.ContainingSymbol;