8 implementations of ContainingSymbol
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.Features (1)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (2)
632 references to ContainingSymbol
ConfigurationSchemaGenerator (2)
ILLink.RoslynAnalyzer (14)
Microsoft.Analyzers.Extra (7)
Microsoft.Analyzers.Local (1)
Microsoft.AspNetCore.App.Analyzers (3)
Microsoft.AspNetCore.App.SourceGenerators (1)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (2)
Microsoft.CodeAnalysis (24)
Microsoft.CodeAnalysis.CodeStyle (66)
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);
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
Microsoft.CodeAnalysis.CSharp (5)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (46)
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)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (79)
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)
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);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (12)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (10)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (7)
Microsoft.CodeAnalysis.Features (42)
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;
Microsoft.CodeAnalysis.Test.Utilities (8)
Microsoft.CodeAnalysis.VisualBasic (7)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (3)
Microsoft.CodeAnalysis.VisualBasic.Features (3)
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())
Microsoft.CodeAnalysis.VisualBasic.Workspaces (10)
Microsoft.CodeAnalysis.Workspaces (99)
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);
Microsoft.Extensions.Logging.Generators (2)
Microsoft.Extensions.Options.SourceGeneration (2)
Microsoft.Gen.Logging (4)
Microsoft.Gen.Metrics (3)
Microsoft.Gen.MetricsReports (1)
Microsoft.Interop.ComInterfaceGenerator (2)
Microsoft.Interop.LibraryImportGenerator (2)
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
Microsoft.Interop.SourceGeneration (4)
Microsoft.ML.InternalCodeAnalyzer (1)
Microsoft.VisualStudio.LanguageServices (12)
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;
Microsoft.VisualStudio.LanguageServices.VisualBasic (3)
System.Private.CoreLib.Generators (7)
System.Text.Json.SourceGeneration (2)
System.Text.RegularExpressions.Generator (2)