1 interface inheriting from IAssemblySymbol
Microsoft.CodeAnalysis (1)
Symbols\ISourceAssemblySymbol.cs (1)
14public interface ISourceAssemblySymbol : IAssemblySymbol
2 implementations of IAssemblySymbol
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\AssemblySymbol.cs (1)
15internal abstract class AssemblySymbol : Symbol, IAssemblySymbol
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\AssemblySymbol.vb (1)
23Implements IAssemblySymbol, IAssemblySymbolInternal
1454 references to IAssemblySymbol
Analyzer.Utilities.UnitTests (1)
Lightup\LightupHelpersTests.cs (1)
105IAssemblySymbol ISymbol.ContainingAssembly => throw new NotImplementedException();
ConfigurationSchemaGenerator (4)
ConfigSchemaGenerator.cs (3)
24var assemblySymbol = (IAssemblySymbol)compilation.GetAssemblyOrModuleSymbol(inputReference); 53internal static ConfigSchemaAttributeInfo? GetConfigurationSchema(IAssemblySymbol assembly)
RuntimeSource\Roslyn\GetBestTypeByMetadataName.cs (1)
51foreach (var referencedAssembly in module.ReferencedAssemblySymbols)
ILLink.RoslynAnalyzer (11)
CompilationExtensions.cs (1)
53foreach (var referencedAssembly in module.ReferencedAssemblySymbols)
RequiresAnalyzerBase.cs (2)
389var refAssembly = context.Compilation.GetAssemblyOrModuleSymbol(reference) as IAssemblySymbol;
TrimAnalysis\TypeNameResolver.cs (8)
66ITypeSymbol? ResolveTypeName(IAssemblySymbol assembly, TypeName typeName) 97private ITypeSymbol? GetSimpleType(IAssemblySymbol assembly, TypeName typeName) 99IAssemblySymbol module = assembly; 102if (ResolveAssembly(assemblyName) is not IAssemblySymbol resolvedAssembly) 114private static ITypeSymbol? GetSimpleTypeFromModule(TypeName typeName, IAssemblySymbol module) 120private ITypeSymbol? GetGenericType(IAssemblySymbol assembly, TypeName typeName) 136IAssemblySymbol? ResolveAssembly(AssemblyNameInfo? assemblyName) 146if (_compilation.GetAssemblyOrModuleSymbol(metadataReference) is not IAssemblySymbol asmSym)
Metrics (59)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (5)
20IAssemblySymbol symbol, int maintainabilityIndex, 31internal static async Task<AssemblyMetricData> ComputeAsync(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 37internal static AssemblyMetricData ComputeSynchronously(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 43private static AssemblyMetricData ComputeFromChildren(IAssemblySymbol assembly, ImmutableArray<CodeAnalysisMetricData> children, CodeMetricsAnalysisContext context) 72private static ImmutableArray<INamespaceOrTypeSymbol> GetChildSymbols(IAssemblySymbol assembly)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
267SymbolKind.Assembly => await AssemblyMetricData.ComputeAsync((IAssemblySymbol)symbol, context).ConfigureAwait(false), 305SymbolKind.Assembly => AssemblyMetricData.ComputeSynchronously((IAssemblySymbol)symbol, context),
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (5)
33_referencedAssemblies = new Lazy<ImmutableArray<IAssemblySymbol>>( 38.Distinct<IAssemblySymbol>(SymbolEqualityComparer.Default) 62private readonly Lazy<ImmutableArray<IAssemblySymbol>> _referencedAssemblies; 72/// so we can query <see cref="IAssemblySymbol.NamespaceNames"/>. 145foreach (IAssemblySymbol? referencedAssembly in _referencedAssemblies.Value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (5)
9private sealed class AssemblySymbolKey : AbstractSymbolKey<IAssemblySymbol> 13public sealed override void Create(IAssemblySymbol symbol, SymbolKeyWriter visitor) 21SymbolKeyReader reader, IAssemblySymbol? contextualSymbol, out string? failureReason) 27using var result = PooledArrayBuilder<IAssemblySymbol>.GetInstance(); 34foreach (var assembly in compilation.GetReferencedAssemblySymbols())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
28/// <item>Two <see cref="IAssemblySymbol"/>s are the "same" if 29/// they have equal <see cref="IAssemblySymbol.Identity"/>.Name</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (1)
32if (symbol is not IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
93case IAssemblySymbol assembly:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
700if (assemblyResolution.GetAnySymbol() is IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
335public override void VisitAssembly(IAssemblySymbol assemblySymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (2)
48public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 66var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IAssemblySymbolExtensions.cs (7)
17this List<IAssemblySymbol> assemblies, 22foreach (var a in assemblies) 33public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false) 39foreach (var a in assemblies) 50foreach (var a in assemblies) 63public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
538[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (13)
23if (within is IAssemblySymbol assembly) 42IAssemblySymbol within, 92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 213IAssemblySymbol assembly, 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 219var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 261var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 335IAssemblySymbol withinAssembly, 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.AssemblyComparers.cs (5)
13private sealed class SimpleNameAssemblyComparer : IEqualityComparer<IAssemblySymbol?> 15public static readonly IEqualityComparer<IAssemblySymbol> Instance = new SimpleNameAssemblyComparer(); 17public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 20public int GetHashCode(IAssemblySymbol? obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
50private readonly IEqualityComparer<IAssemblySymbol>? _assemblyComparer; 62IEqualityComparer<IAssemblySymbol>? assemblyComparer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
118SymbolKind.Assembly => AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y), 149private bool AssembliesAreEquivalent(IAssemblySymbol x, IAssemblySymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
63SymbolKind.Assembly => CombineHashCodes((IAssemblySymbol)x, currentHash), 89private int CombineHashCodes(IAssemblySymbol x, int currentHash)
Metrics.Legacy (59)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (5)
20IAssemblySymbol symbol, int maintainabilityIndex, 31internal static async Task<AssemblyMetricData> ComputeAsync(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 37internal static AssemblyMetricData ComputeSynchronously(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 43private static AssemblyMetricData ComputeFromChildren(IAssemblySymbol assembly, ImmutableArray<CodeAnalysisMetricData> children, CodeMetricsAnalysisContext context) 72private static ImmutableArray<INamespaceOrTypeSymbol> GetChildSymbols(IAssemblySymbol assembly)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
267SymbolKind.Assembly => await AssemblyMetricData.ComputeAsync((IAssemblySymbol)symbol, context).ConfigureAwait(false), 305SymbolKind.Assembly => AssemblyMetricData.ComputeSynchronously((IAssemblySymbol)symbol, context),
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (5)
33_referencedAssemblies = new Lazy<ImmutableArray<IAssemblySymbol>>( 38.Distinct<IAssemblySymbol>(SymbolEqualityComparer.Default) 62private readonly Lazy<ImmutableArray<IAssemblySymbol>> _referencedAssemblies; 72/// so we can query <see cref="IAssemblySymbol.NamespaceNames"/>. 145foreach (IAssemblySymbol? referencedAssembly in _referencedAssemblies.Value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (5)
9private sealed class AssemblySymbolKey : AbstractSymbolKey<IAssemblySymbol> 13public sealed override void Create(IAssemblySymbol symbol, SymbolKeyWriter visitor) 21SymbolKeyReader reader, IAssemblySymbol? contextualSymbol, out string? failureReason) 27using var result = PooledArrayBuilder<IAssemblySymbol>.GetInstance(); 34foreach (var assembly in compilation.GetReferencedAssemblySymbols())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
28/// <item>Two <see cref="IAssemblySymbol"/>s are the "same" if 29/// they have equal <see cref="IAssemblySymbol.Identity"/>.Name</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (1)
32if (symbol is not IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
93case IAssemblySymbol assembly:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
700if (assemblyResolution.GetAnySymbol() is IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
335public override void VisitAssembly(IAssemblySymbol assemblySymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (2)
48public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 66var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IAssemblySymbolExtensions.cs (7)
17this List<IAssemblySymbol> assemblies, 22foreach (var a in assemblies) 33public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false) 39foreach (var a in assemblies) 50foreach (var a in assemblies) 63public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
538[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (13)
23if (within is IAssemblySymbol assembly) 42IAssemblySymbol within, 92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 213IAssemblySymbol assembly, 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 219var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 261var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 335IAssemblySymbol withinAssembly, 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.AssemblyComparers.cs (5)
13private sealed class SimpleNameAssemblyComparer : IEqualityComparer<IAssemblySymbol?> 15public static readonly IEqualityComparer<IAssemblySymbol> Instance = new SimpleNameAssemblyComparer(); 17public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 20public int GetHashCode(IAssemblySymbol? obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
50private readonly IEqualityComparer<IAssemblySymbol>? _assemblyComparer; 62IEqualityComparer<IAssemblySymbol>? assemblyComparer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
118SymbolKind.Assembly => AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y), 149private bool AssembliesAreEquivalent(IAssemblySymbol x, IAssemblySymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
63SymbolKind.Assembly => CombineHashCodes((IAssemblySymbol)x, currentHash), 89private int CombineHashCodes(IAssemblySymbol x, int currentHash)
Microsoft.AspNetCore.Analyzers (2)
ConfigureMethodVisitor.cs (2)
11public static List<IMethodSymbol> FindConfigureMethods(StartupSymbols symbols, IAssemblySymbol assembly) 27public override void VisitAssembly(IAssemblySymbol symbol)
Microsoft.AspNetCore.OpenApi.SourceGenerators (2)
Helpers\AssemblyTypeSymbolsVisitor.cs (2)
15internal sealed class AssemblyTypeSymbolsVisitor(IAssemblySymbol assemblySymbol, CancellationToken cancellation) : SymbolVisitor 28public override void VisitAssembly(IAssemblySymbol symbol)
Microsoft.CodeAnalysis (27)
CommandLine\CommonCompiler.cs (2)
605var currentAssembly = compilation.Assembly; 614foreach (var assembly in currentAssembly.Modules.First().ReferencedAssemblySymbols.OrderBy(a => a.Name))
Compilation\Compilation.cs (13)
884/// Gets the <see cref="IAssemblySymbol"/> or <see cref="IModuleSymbol"/> for a metadata reference used to create this 905public MetadataReference? GetMetadataReference(IAssemblySymbol assemblySymbol) 910private protected abstract MetadataReference? CommonGetMetadataReference(IAssemblySymbol assemblySymbol); 926/// The <see cref="IAssemblySymbol"/> that represents the assembly being created. 928public IAssemblySymbol Assembly { get { return CommonAssembly; } } 929protected abstract IAssemblySymbol CommonAssembly { get; } 1262var corLib = ObjectType.ContainingAssembly; 1269foreach (var referencedAssembly in SourceModule.ReferencedAssemblySymbols) 1613/// compilation. <paramref name="within"/> is required to be an <see cref="INamedTypeSymbol"/> or <see cref="IAssemblySymbol"/>. 1641if (!(within is INamedTypeSymbol || within is IAssemblySymbol)) 1663bool assemblyIsInReferences(IAssemblySymbol a) 1687bool assemblyIsInCompilationReferences(IAssemblySymbol a, Compilation compilation) 1712return assemblyIsInReferences((IAssemblySymbol)s);
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (1)
313Debug.Assert(symbol is IAssemblySymbol || symbol is IModuleSymbol);
PEWriter\MetadataWriter.PortablePdb.cs (1)
968var peReader = pair.AssemblySymbol.GetISymbol() is IAssemblySymbol assemblySymbol
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (1)
158if (symbol is IAssemblySymbol assemblySymbol)
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (1)
77var assemblyToScope = model.Compilation.Assembly;
Symbols\IAssemblySymbol.cs (1)
56bool GivesAccessTo(IAssemblySymbol toAssembly);
Symbols\IModuleSymbol.cs (1)
42ImmutableArray<IAssemblySymbol> ReferencedAssemblySymbols { get; }
Symbols\ISymbol.cs (2)
73/// Gets the <see cref="IAssemblySymbol"/> for the containing assembly. Returns null if the 76IAssemblySymbol ContainingAssembly { get; }
Symbols\ISymbolExtensions.cs (1)
106internal static bool IsNetModule(this IAssemblySymbol assembly) =>
Symbols\SymbolVisitor.cs (1)
28public virtual void VisitAssembly(IAssemblySymbol symbol)
Symbols\SymbolVisitor`1.cs (1)
31public virtual TResult? VisitAssembly(IAssemblySymbol symbol)
Symbols\SymbolVisitor`2.cs (1)
36public virtual TResult VisitAssembly(IAssemblySymbol symbol, TArgument argument)
Microsoft.CodeAnalysis.Analyzers (67)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (5)
20IAssemblySymbol symbol, int maintainabilityIndex, 31internal static async Task<AssemblyMetricData> ComputeAsync(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 37internal static AssemblyMetricData ComputeSynchronously(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 43private static AssemblyMetricData ComputeFromChildren(IAssemblySymbol assembly, ImmutableArray<CodeAnalysisMetricData> children, CodeMetricsAnalysisContext context) 72private static ImmutableArray<INamespaceOrTypeSymbol> GetChildSymbols(IAssemblySymbol assembly)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
267SymbolKind.Assembly => await AssemblyMetricData.ComputeAsync((IAssemblySymbol)symbol, context).ConfigureAwait(false), 305SymbolKind.Assembly => AssemblyMetricData.ComputeSynchronously((IAssemblySymbol)symbol, context),
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (5)
33_referencedAssemblies = new Lazy<ImmutableArray<IAssemblySymbol>>( 38.Distinct<IAssemblySymbol>(SymbolEqualityComparer.Default) 62private readonly Lazy<ImmutableArray<IAssemblySymbol>> _referencedAssemblies; 72/// so we can query <see cref="IAssemblySymbol.NamespaceNames"/>. 145foreach (IAssemblySymbol? referencedAssembly in _referencedAssemblies.Value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (5)
9private sealed class AssemblySymbolKey : AbstractSymbolKey<IAssemblySymbol> 13public sealed override void Create(IAssemblySymbol symbol, SymbolKeyWriter visitor) 21SymbolKeyReader reader, IAssemblySymbol? contextualSymbol, out string? failureReason) 27using var result = PooledArrayBuilder<IAssemblySymbol>.GetInstance(); 34foreach (var assembly in compilation.GetReferencedAssemblySymbols())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
28/// <item>Two <see cref="IAssemblySymbol"/>s are the "same" if 29/// they have equal <see cref="IAssemblySymbol.Identity"/>.Name</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (1)
32if (symbol is not IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
93case IAssemblySymbol assembly:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
700if (assemblyResolution.GetAnySymbol() is IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
335public override void VisitAssembly(IAssemblySymbol assemblySymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (2)
48public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 66var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IAssemblySymbolExtensions.cs (7)
17this List<IAssemblySymbol> assemblies, 22foreach (var a in assemblies) 33public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false) 39foreach (var a in assemblies) 50foreach (var a in assemblies) 63public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
538[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (13)
23if (within is IAssemblySymbol assembly) 42IAssemblySymbol within, 92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 213IAssemblySymbol assembly, 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 219var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 261var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 335IAssemblySymbol withinAssembly, 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.AssemblyComparers.cs (5)
13private sealed class SimpleNameAssemblyComparer : IEqualityComparer<IAssemblySymbol?> 15public static readonly IEqualityComparer<IAssemblySymbol> Instance = new SimpleNameAssemblyComparer(); 17public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 20public int GetHashCode(IAssemblySymbol? obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
50private readonly IEqualityComparer<IAssemblySymbol>? _assemblyComparer; 62IEqualityComparer<IAssemblySymbol>? assemblyComparer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
118SymbolKind.Assembly => AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y), 149private bool AssembliesAreEquivalent(IAssemblySymbol x, IAssemblySymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
63SymbolKind.Assembly => CombineHashCodes((IAssemblySymbol)x, currentHash), 89private int CombineHashCodes(IAssemblySymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
425IAssemblySymbol? containingAssembly = null) 444IAssemblySymbol? containingAssembly = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
30IAssemblySymbol containingAssembly, 79public IAssemblySymbol ContainingAssembly { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,
Microsoft.CodeAnalysis.AnalyzerUtilities (59)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (5)
20IAssemblySymbol symbol, int maintainabilityIndex, 31internal static async Task<AssemblyMetricData> ComputeAsync(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 37internal static AssemblyMetricData ComputeSynchronously(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 43private static AssemblyMetricData ComputeFromChildren(IAssemblySymbol assembly, ImmutableArray<CodeAnalysisMetricData> children, CodeMetricsAnalysisContext context) 72private static ImmutableArray<INamespaceOrTypeSymbol> GetChildSymbols(IAssemblySymbol assembly)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
267SymbolKind.Assembly => await AssemblyMetricData.ComputeAsync((IAssemblySymbol)symbol, context).ConfigureAwait(false), 305SymbolKind.Assembly => AssemblyMetricData.ComputeSynchronously((IAssemblySymbol)symbol, context),
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (5)
33_referencedAssemblies = new Lazy<ImmutableArray<IAssemblySymbol>>( 38.Distinct<IAssemblySymbol>(SymbolEqualityComparer.Default) 62private readonly Lazy<ImmutableArray<IAssemblySymbol>> _referencedAssemblies; 72/// so we can query <see cref="IAssemblySymbol.NamespaceNames"/>. 145foreach (IAssemblySymbol? referencedAssembly in _referencedAssemblies.Value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (5)
9private sealed class AssemblySymbolKey : AbstractSymbolKey<IAssemblySymbol> 13public sealed override void Create(IAssemblySymbol symbol, SymbolKeyWriter visitor) 21SymbolKeyReader reader, IAssemblySymbol? contextualSymbol, out string? failureReason) 27using var result = PooledArrayBuilder<IAssemblySymbol>.GetInstance(); 34foreach (var assembly in compilation.GetReferencedAssemblySymbols())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
28/// <item>Two <see cref="IAssemblySymbol"/>s are the "same" if 29/// they have equal <see cref="IAssemblySymbol.Identity"/>.Name</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (1)
32if (symbol is not IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
93case IAssemblySymbol assembly:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
700if (assemblyResolution.GetAnySymbol() is IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
335public override void VisitAssembly(IAssemblySymbol assemblySymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (2)
48public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 66var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IAssemblySymbolExtensions.cs (7)
17this List<IAssemblySymbol> assemblies, 22foreach (var a in assemblies) 33public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false) 39foreach (var a in assemblies) 50foreach (var a in assemblies) 63public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
538[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (13)
23if (within is IAssemblySymbol assembly) 42IAssemblySymbol within, 92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 213IAssemblySymbol assembly, 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 219var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 261var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 335IAssemblySymbol withinAssembly, 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.AssemblyComparers.cs (5)
13private sealed class SimpleNameAssemblyComparer : IEqualityComparer<IAssemblySymbol?> 15public static readonly IEqualityComparer<IAssemblySymbol> Instance = new SimpleNameAssemblyComparer(); 17public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 20public int GetHashCode(IAssemblySymbol? obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
50private readonly IEqualityComparer<IAssemblySymbol>? _assemblyComparer; 62IEqualityComparer<IAssemblySymbol>? assemblyComparer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
118SymbolKind.Assembly => AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y), 149private bool AssembliesAreEquivalent(IAssemblySymbol x, IAssemblySymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
63SymbolKind.Assembly => CombineHashCodes((IAssemblySymbol)x, currentHash), 89private int CombineHashCodes(IAssemblySymbol x, int currentHash)
Microsoft.CodeAnalysis.BannedApiAnalyzers (74)
RestrictedInternalsVisibleToAnalyzer.cs (7)
117private static ImmutableDictionary<IAssemblySymbol, ImmutableSortedSet<string>> GetRestrictedInternalsVisibleToMap(Compilation compilation) 122return ImmutableDictionary<IAssemblySymbol, ImmutableSortedSet<string>>.Empty; 125var builder = ImmutableDictionary.CreateBuilder<IAssemblySymbol, ImmutableSortedSet<string>>(); 126foreach (var referencedAssemblySymbol in compilation.References.Select(compilation.GetAssemblyOrModuleSymbol).OfType<IAssemblySymbol>()) 190ImmutableDictionary<IAssemblySymbol, ImmutableSortedSet<string>> restrictedInternalsVisibleToMap, 206ImmutableDictionary<IAssemblySymbol, ImmutableSortedSet<string>> restrictedInternalsVisibleToMap,
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (5)
20IAssemblySymbol symbol, int maintainabilityIndex, 31internal static async Task<AssemblyMetricData> ComputeAsync(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 37internal static AssemblyMetricData ComputeSynchronously(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 43private static AssemblyMetricData ComputeFromChildren(IAssemblySymbol assembly, ImmutableArray<CodeAnalysisMetricData> children, CodeMetricsAnalysisContext context) 72private static ImmutableArray<INamespaceOrTypeSymbol> GetChildSymbols(IAssemblySymbol assembly)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
267SymbolKind.Assembly => await AssemblyMetricData.ComputeAsync((IAssemblySymbol)symbol, context).ConfigureAwait(false), 305SymbolKind.Assembly => AssemblyMetricData.ComputeSynchronously((IAssemblySymbol)symbol, context),
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (5)
33_referencedAssemblies = new Lazy<ImmutableArray<IAssemblySymbol>>( 38.Distinct<IAssemblySymbol>(SymbolEqualityComparer.Default) 62private readonly Lazy<ImmutableArray<IAssemblySymbol>> _referencedAssemblies; 72/// so we can query <see cref="IAssemblySymbol.NamespaceNames"/>. 145foreach (IAssemblySymbol? referencedAssembly in _referencedAssemblies.Value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (5)
9private sealed class AssemblySymbolKey : AbstractSymbolKey<IAssemblySymbol> 13public sealed override void Create(IAssemblySymbol symbol, SymbolKeyWriter visitor) 21SymbolKeyReader reader, IAssemblySymbol? contextualSymbol, out string? failureReason) 27using var result = PooledArrayBuilder<IAssemblySymbol>.GetInstance(); 34foreach (var assembly in compilation.GetReferencedAssemblySymbols())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
28/// <item>Two <see cref="IAssemblySymbol"/>s are the "same" if 29/// they have equal <see cref="IAssemblySymbol.Identity"/>.Name</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (1)
32if (symbol is not IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
93case IAssemblySymbol assembly:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
700if (assemblyResolution.GetAnySymbol() is IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
335public override void VisitAssembly(IAssemblySymbol assemblySymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (2)
48public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 66var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IAssemblySymbolExtensions.cs (7)
17this List<IAssemblySymbol> assemblies, 22foreach (var a in assemblies) 33public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false) 39foreach (var a in assemblies) 50foreach (var a in assemblies) 63public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
538[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (13)
23if (within is IAssemblySymbol assembly) 42IAssemblySymbol within, 92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 213IAssemblySymbol assembly, 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 219var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 261var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 335IAssemblySymbol withinAssembly, 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.AssemblyComparers.cs (5)
13private sealed class SimpleNameAssemblyComparer : IEqualityComparer<IAssemblySymbol?> 15public static readonly IEqualityComparer<IAssemblySymbol> Instance = new SimpleNameAssemblyComparer(); 17public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 20public int GetHashCode(IAssemblySymbol? obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
50private readonly IEqualityComparer<IAssemblySymbol>? _assemblyComparer; 62IEqualityComparer<IAssemblySymbol>? assemblyComparer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
118SymbolKind.Assembly => AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y), 149private bool AssembliesAreEquivalent(IAssemblySymbol x, IAssemblySymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
63SymbolKind.Assembly => CombineHashCodes((IAssemblySymbol)x, currentHash), 89private int CombineHashCodes(IAssemblySymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
425IAssemblySymbol? containingAssembly = null) 444IAssemblySymbol? containingAssembly = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
30IAssemblySymbol containingAssembly, 79public IAssemblySymbol ContainingAssembly { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,
Microsoft.CodeAnalysis.CodeStyle (47)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (5)
9private sealed class AssemblySymbolKey : AbstractSymbolKey<IAssemblySymbol> 13public sealed override void Create(IAssemblySymbol symbol, SymbolKeyWriter visitor) 21SymbolKeyReader reader, IAssemblySymbol? contextualSymbol, out string? failureReason) 27using var result = PooledArrayBuilder<IAssemblySymbol>.GetInstance(); 34foreach (var assembly in compilation.GetReferencedAssemblySymbols())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
28/// <item>Two <see cref="IAssemblySymbol"/>s are the "same" if 29/// they have equal <see cref="IAssemblySymbol.Identity"/>.Name</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (1)
32if (symbol is not IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
93case IAssemblySymbol assembly:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
700if (assemblyResolution.GetAnySymbol() is IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
335public override void VisitAssembly(IAssemblySymbol assemblySymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (2)
48public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 66var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IAssemblySymbolExtensions.cs (7)
17this List<IAssemblySymbol> assemblies, 22foreach (var a in assemblies) 33public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false) 39foreach (var a in assemblies) 50foreach (var a in assemblies) 63public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
538[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (13)
23if (within is IAssemblySymbol assembly) 42IAssemblySymbol within, 92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 213IAssemblySymbol assembly, 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 219var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 261var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 335IAssemblySymbol withinAssembly, 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.AssemblyComparers.cs (5)
13private sealed class SimpleNameAssemblyComparer : IEqualityComparer<IAssemblySymbol?> 15public static readonly IEqualityComparer<IAssemblySymbol> Instance = new SimpleNameAssemblyComparer(); 17public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 20public int GetHashCode(IAssemblySymbol? obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
50private readonly IEqualityComparer<IAssemblySymbol>? _assemblyComparer; 62IEqualityComparer<IAssemblySymbol>? assemblyComparer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
118SymbolKind.Assembly => AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y), 149private bool AssembliesAreEquivalent(IAssemblySymbol x, IAssemblySymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
63SymbolKind.Assembly => CombineHashCodes((IAssemblySymbol)x, currentHash), 89private int CombineHashCodes(IAssemblySymbol x, int currentHash)
Microsoft.CodeAnalysis.CodeStyle.Fixes (8)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
425IAssemblySymbol? containingAssembly = null) 444IAssemblySymbol? containingAssembly = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
30IAssemblySymbol containingAssembly, 79public IAssemblySymbol ContainingAssembly { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,
Microsoft.CodeAnalysis.CSharp (26)
Compilation\CSharpCompilation.cs (3)
1406public new MetadataReference? GetMetadataReference(IAssemblySymbol assemblySymbol) 1411private protected override MetadataReference? CommonGetMetadataReference(IAssemblySymbol assemblySymbol) 4047protected override IAssemblySymbol CommonAssembly
SymbolDisplay\SymbolDisplayVisitor.cs (1)
151public override void VisitAssembly(IAssemblySymbol symbol)
Symbols\PublicModel\AssemblySymbol.cs (13)
21INamespaceSymbol IAssemblySymbol.GlobalNamespace 29IEnumerable<IModuleSymbol> IAssemblySymbol.Modules 40bool IAssemblySymbol.IsInteractive => UnderlyingAssemblySymbol.IsInteractive; 42AssemblyIdentity IAssemblySymbol.Identity => UnderlyingAssemblySymbol.Identity; 44ICollection<string> IAssemblySymbol.TypeNames => UnderlyingAssemblySymbol.TypeNames; 46ICollection<string> IAssemblySymbol.NamespaceNames => UnderlyingAssemblySymbol.NamespaceNames; 48bool IAssemblySymbol.MightContainExtensionMethods => UnderlyingAssemblySymbol.MightContainExtensionMethods; 50AssemblyMetadata IAssemblySymbol.GetMetadata() => UnderlyingAssemblySymbol.GetMetadata(); 52INamedTypeSymbol IAssemblySymbol.ResolveForwardedType(string fullyQualifiedMetadataName) 57ImmutableArray<INamedTypeSymbol> IAssemblySymbol.GetForwardedTypes() 63bool IAssemblySymbol.GivesAccessTo(IAssemblySymbol assemblyWantingAccess) 105INamedTypeSymbol? IAssemblySymbol.GetTypeByMetadataName(string metadataName)
Symbols\PublicModel\ModuleSymbol.cs (1)
37ImmutableArray<IAssemblySymbol> IModuleSymbol.ReferencedAssemblySymbols
Symbols\PublicModel\PreprocessingSymbol.cs (1)
108IAssemblySymbol? ISymbol.ContainingAssembly => null;
Symbols\PublicModel\Symbol.cs (1)
205IAssemblySymbol ISymbol.ContainingAssembly => UnderlyingSymbol.ContainingAssembly.GetPublicSymbol();
Symbols\SymbolExtensions.cs (6)
389internal static AssemblySymbol? EnsureCSharpSymbolOrNull(this IAssemblySymbol? symbol, string paramName) 592internal static IAssemblySymbol? GetPublicSymbol(this AssemblySymbol? symbol) 594return symbol.GetPublicSymbol<IAssemblySymbol>(); 736internal static ImmutableArray<IAssemblySymbol> GetPublicSymbols(this ImmutableArray<AssemblySymbol> symbols) 738return GetPublicSymbols<IAssemblySymbol>(StaticCast<Symbol>.From(symbols)); 789internal static AssemblySymbol? GetSymbol(this IAssemblySymbol? symbol)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
InteractiveSessionReferencesTests.cs (1)
153var missingB = m.ReferencedAssemblySymbols.Single(a => a.Name == "libA").Modules.Single().ReferencedAssemblySymbols.Single(a => a.Name == "libB");
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\AccessCheckTests.cs (4)
738IAssemblySymbol sourceAssem = c.SourceModule.ContainingAssembly; 739IAssemblySymbol mscorlibAssem = ((CSharpCompilation)c).GetReferencedAssemblySymbol(c.ExternalReferences[0]).GetPublicSymbol(); 899IAssemblySymbol sourceAssem = c1.SourceModule.ContainingAssembly; 900IAssemblySymbol mscorlibAssem = ((CSharpCompilation)c1).GetReferencedAssemblySymbol(c1.ExternalReferences[0]).GetPublicSymbol();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (14)
Compilation\CompilationAPITests.cs (3)
2368var assembly = (IAssemblySymbol)vbComp.GetBoundReferenceManager().GetReferencedAssemblies().First().Value; 2372Assert.Null(comp.GetMetadataReference((IAssemblySymbol)null));
Compilation\SymbolVisitorTests.cs (9)
56public override void VisitAssembly(IAssemblySymbol symbol) 227public override string VisitAssembly(IAssemblySymbol symbol) 390public override int VisitAssembly(IAssemblySymbol symbol, StringBuilder argument) 536IAssemblySymbol asm = new SourceAssemblySymbol(c.SourceAssembly); 587IAssemblySymbol asm = new SourceAssemblySymbol(c.SourceAssembly); 638IAssemblySymbol asm = new SourceAssemblySymbol(c.SourceAssembly); 695IAssemblySymbol asm = new SourceAssemblySymbol(c.SourceAssembly); 739IAssemblySymbol asm = new SourceAssemblySymbol(c.SourceAssembly); 783IAssemblySymbol asm = new SourceAssemblySymbol(c.SourceAssembly);
Symbols\Metadata\PE\TypeForwarders.cs (1)
1564private static IEnumerable<string> GetNamesOfForwardedTypes(IAssemblySymbol assembly)
Symbols\Source\ExternAliasTests.cs (1)
484var aliasedGlobalNamespace = ((IAssemblySymbol)comp.GetAssemblyOrModuleSymbol(libRef)).GlobalNamespace;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (7)
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (2)
178var assemblySymbol = (IAssemblySymbol?)compilation.GetAssemblyOrModuleSymbol(reference);
Utilities\SymbolEquivalenceComparerTests.cs (5)
1885private sealed class AssemblySymbolIdentityComparer : IEqualityComparer<IAssemblySymbol> 1887public static readonly IEqualityComparer<IAssemblySymbol> Instance = new AssemblySymbolIdentityComparer(); 1889public bool Equals(IAssemblySymbol x, IAssemblySymbol y) 1892public int GetHashCode(IAssemblySymbol obj)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
AbstractTypeParameterChecker.cs (1)
145public sealed override void VisitAssembly(IAssemblySymbol symbol)
Microsoft.CodeAnalysis.Extensions.Package (36)
Compilation\CompilationExtensions.cs (2)
48public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 66var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
Symbols\IAssemblySymbolExtensions.cs (7)
17this List<IAssemblySymbol> assemblies, 22foreach (var a in assemblies) 33public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false) 39foreach (var a in assemblies) 50foreach (var a in assemblies) 63public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
Symbols\ISymbolExtensions.cs (1)
538[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken)
Symbols\ISymbolExtensions_Accessibility.cs (13)
23if (within is IAssemblySymbol assembly) 42IAssemblySymbol within, 92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 213IAssemblySymbol assembly, 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 219var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 261var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 335IAssemblySymbol withinAssembly, 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol);
Symbols\SymbolEquivalenceComparer.AssemblyComparers.cs (5)
13private sealed class SimpleNameAssemblyComparer : IEqualityComparer<IAssemblySymbol?> 15public static readonly IEqualityComparer<IAssemblySymbol> Instance = new SimpleNameAssemblyComparer(); 17public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 20public int GetHashCode(IAssemblySymbol? obj)
Symbols\SymbolEquivalenceComparer.cs (2)
50private readonly IEqualityComparer<IAssemblySymbol>? _assemblyComparer; 62IEqualityComparer<IAssemblySymbol>? assemblyComparer,
Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
118SymbolKind.Assembly => AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y), 149private bool AssembliesAreEquivalent(IAssemblySymbol x, IAssemblySymbol y)
Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
63SymbolKind.Assembly => CombineHashCodes((IAssemblySymbol)x, currentHash), 89private int CombineHashCodes(IAssemblySymbol x, int currentHash)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
MetadataAsSource\OmniSharpMetadataAsSourceHelpers.cs (2)
13public static string GetAssemblyInfo(IAssemblySymbol assemblySymbol) 16public static string GetAssemblyDisplay(Compilation compilation, IAssemblySymbol assemblySymbol)
Microsoft.CodeAnalysis.Features (44)
AddImport\AbstractAddImportFeatureService.cs (4)
147var projectToAssembly = new ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol?>>(concurrencyLevel: 2, capacity: project.Solution.ProjectIds.Count); 172ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol?>> projectToAssembly, 217ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol?>> projectToAssembly, 298if (compilation.GetAssemblyOrModuleSymbol(reference) is not IAssemblySymbol assembly)
AddImport\SearchScopes\MetadataSymbolsSearchScope.cs (2)
18IAssemblySymbol assembly, 23private readonly IAssemblySymbol _assembly = assembly;
AddImport\SearchScopes\SourceSymbolsProjectSearchScope.cs (4)
24ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol?>> projectToAssembly, 27private readonly ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol?>> _projectToAssembly = projectToAssembly; 50static AsyncLazy<IAssemblySymbol?> CreateLazyAssembly(Project project) 54return (IAssemblySymbol?)compilation.Assembly;
AddImport\SymbolReferenceFinder.cs (2)
98internal Task<ImmutableArray<SymbolReference>> FindInSourceSymbolsInProjectAsync(ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol?>> projectToAssembly, Project project, bool exact, CancellationToken cancellationToken) 101internal Task<ImmutableArray<SymbolReference>> FindInMetadataSymbolsAsync(IAssemblySymbol assembly, Project assemblyProject, PortableExecutableReference metadataReference, bool exact, CancellationToken cancellationToken)
AddImport\SymbolReferenceFinder_PackageAssemblySearch.cs (2)
195var assemblySymbol = compilation.GetAssemblyOrModuleSymbol(reference) as IAssemblySymbol;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (1)
182var targetSymbol = compilation.Assembly;
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (2)
206originCompilation.GetAssemblyOrModuleSymbol(peReference) is not IAssemblySymbol assemblySymbol) 224IAssemblySymbol assembly,
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (4)
156var originatingAssembly = _originatingSemanticModel.Compilation.Assembly; 164var assembly = compilation.Assembly; 210_originatingSemanticModel.Compilation.GetAssemblyOrModuleSymbol(peReference) is not IAssemblySymbol assembly) 347IAssemblySymbol assembly,
Completion\Providers\ImportCompletionProvider\TypeImportCompletionCacheEntry.cs (1)
64if (AssemblySymbolKey.Resolve(originCompilation).Symbol is not IAssemblySymbol assemblySymbol)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
909IAssemblySymbol containingAssembly,
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (5)
2510private sealed class AssemblyEqualityComparer : IEqualityComparer<IAssemblySymbol?> 2512public static readonly IEqualityComparer<IAssemblySymbol?> Instance = new AssemblyEqualityComparer(); 2514public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 2528public int GetHashCode(IAssemblySymbol? obj)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (3)
138var assembly = symbol.ContainingAssembly; 209private void EnqueueFullProjectDependency(Project project, IAssemblySymbol? internalVisibleToAssembly = null) 232var assembly = compilation.Assembly;
FindUsages\DefinitionItemFactory.cs (5)
158internal static AssemblyLocation GetMetadataLocation(IAssemblySymbol assembly, Solution solution, out ProjectId originatingProjectId) 177var assembly = definition as IAssemblySymbol ?? definition.ContainingAssembly; 210var containingAssembly = constituentNamespace.ContainingAssembly; 237if (definition is IAssemblySymbol or IModuleSymbol or INamespaceSymbol { IsGlobalNamespace: true } or IPreprocessingSymbol)
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
29public override void VisitAssembly(IAssemblySymbol symbol)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
31public IAssemblySymbol ContainingAssembly => _symbol.ContainingAssembly;
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
238private (MetadataReference? metadataReference, string? assemblyLocation, bool isReferenceAssembly) GetReferenceInfo(Compilation compilation, IAssemblySymbol containingAssembly) 400var containingAssembly = topLevelNamedType.ContainingAssembly;
MetadataAsSource\MetadataAsSourceHelpers.cs (3)
33public static string GetAssemblyInfo(IAssemblySymbol assemblySymbol) 41public static string GetAssemblyDisplay(Compilation compilation, IAssemblySymbol assemblySymbol) 104public static bool IsReferenceAssembly(IAssemblySymbol assemblySymbol)
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (1)
77var assemblyToScope = model.Compilation.Assembly;
Microsoft.CodeAnalysis.Features.UnitTests (2)
FindUsages\DefinitionItemFactoryTests.cs (2)
136var a = compilation.Assembly; 172var m = compilation.GetReferencedAssemblySymbols().Single(a => a.Name == "mscorlib");
Microsoft.CodeAnalysis.LanguageServer.Protocol (7)
Features\DecompiledSource\AssemblyResolver.cs (7)
26private readonly Dictionary<string, List<IAssemblySymbol>> _cache = []; 38foreach (var reference in _parentCompilation.GetReferencedAssemblySymbols()) 102IAssemblySymbol highestVersion = null; 103IAssemblySymbol exactMatch = null; 107foreach (var assembly in assemblies) 124var chosen = exactMatch ?? highestVersion; 128PEFile MakePEFile(IAssemblySymbol assembly)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (67)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (5)
20IAssemblySymbol symbol, int maintainabilityIndex, 31internal static async Task<AssemblyMetricData> ComputeAsync(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 37internal static AssemblyMetricData ComputeSynchronously(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 43private static AssemblyMetricData ComputeFromChildren(IAssemblySymbol assembly, ImmutableArray<CodeAnalysisMetricData> children, CodeMetricsAnalysisContext context) 72private static ImmutableArray<INamespaceOrTypeSymbol> GetChildSymbols(IAssemblySymbol assembly)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
267SymbolKind.Assembly => await AssemblyMetricData.ComputeAsync((IAssemblySymbol)symbol, context).ConfigureAwait(false), 305SymbolKind.Assembly => AssemblyMetricData.ComputeSynchronously((IAssemblySymbol)symbol, context),
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (5)
33_referencedAssemblies = new Lazy<ImmutableArray<IAssemblySymbol>>( 38.Distinct<IAssemblySymbol>(SymbolEqualityComparer.Default) 62private readonly Lazy<ImmutableArray<IAssemblySymbol>> _referencedAssemblies; 72/// so we can query <see cref="IAssemblySymbol.NamespaceNames"/>. 145foreach (IAssemblySymbol? referencedAssembly in _referencedAssemblies.Value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (5)
9private sealed class AssemblySymbolKey : AbstractSymbolKey<IAssemblySymbol> 13public sealed override void Create(IAssemblySymbol symbol, SymbolKeyWriter visitor) 21SymbolKeyReader reader, IAssemblySymbol? contextualSymbol, out string? failureReason) 27using var result = PooledArrayBuilder<IAssemblySymbol>.GetInstance(); 34foreach (var assembly in compilation.GetReferencedAssemblySymbols())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
28/// <item>Two <see cref="IAssemblySymbol"/>s are the "same" if 29/// they have equal <see cref="IAssemblySymbol.Identity"/>.Name</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (1)
32if (symbol is not IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
93case IAssemblySymbol assembly:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
700if (assemblyResolution.GetAnySymbol() is IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
335public override void VisitAssembly(IAssemblySymbol assemblySymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (2)
48public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 66var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IAssemblySymbolExtensions.cs (7)
17this List<IAssemblySymbol> assemblies, 22foreach (var a in assemblies) 33public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false) 39foreach (var a in assemblies) 50foreach (var a in assemblies) 63public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
538[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (13)
23if (within is IAssemblySymbol assembly) 42IAssemblySymbol within, 92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 213IAssemblySymbol assembly, 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 219var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 261var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 335IAssemblySymbol withinAssembly, 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.AssemblyComparers.cs (5)
13private sealed class SimpleNameAssemblyComparer : IEqualityComparer<IAssemblySymbol?> 15public static readonly IEqualityComparer<IAssemblySymbol> Instance = new SimpleNameAssemblyComparer(); 17public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 20public int GetHashCode(IAssemblySymbol? obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
50private readonly IEqualityComparer<IAssemblySymbol>? _assemblyComparer; 62IEqualityComparer<IAssemblySymbol>? assemblyComparer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
118SymbolKind.Assembly => AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y), 149private bool AssembliesAreEquivalent(IAssemblySymbol x, IAssemblySymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
63SymbolKind.Assembly => CombineHashCodes((IAssemblySymbol)x, currentHash), 89private int CombineHashCodes(IAssemblySymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
425IAssemblySymbol? containingAssembly = null) 444IAssemblySymbol? containingAssembly = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
30IAssemblySymbol containingAssembly, 79public IAssemblySymbol ContainingAssembly { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,
Microsoft.CodeAnalysis.PublicApiAnalyzers (59)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (5)
20IAssemblySymbol symbol, int maintainabilityIndex, 31internal static async Task<AssemblyMetricData> ComputeAsync(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 37internal static AssemblyMetricData ComputeSynchronously(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 43private static AssemblyMetricData ComputeFromChildren(IAssemblySymbol assembly, ImmutableArray<CodeAnalysisMetricData> children, CodeMetricsAnalysisContext context) 72private static ImmutableArray<INamespaceOrTypeSymbol> GetChildSymbols(IAssemblySymbol assembly)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
267SymbolKind.Assembly => await AssemblyMetricData.ComputeAsync((IAssemblySymbol)symbol, context).ConfigureAwait(false), 305SymbolKind.Assembly => AssemblyMetricData.ComputeSynchronously((IAssemblySymbol)symbol, context),
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (5)
33_referencedAssemblies = new Lazy<ImmutableArray<IAssemblySymbol>>( 38.Distinct<IAssemblySymbol>(SymbolEqualityComparer.Default) 62private readonly Lazy<ImmutableArray<IAssemblySymbol>> _referencedAssemblies; 72/// so we can query <see cref="IAssemblySymbol.NamespaceNames"/>. 145foreach (IAssemblySymbol? referencedAssembly in _referencedAssemblies.Value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (5)
9private sealed class AssemblySymbolKey : AbstractSymbolKey<IAssemblySymbol> 13public sealed override void Create(IAssemblySymbol symbol, SymbolKeyWriter visitor) 21SymbolKeyReader reader, IAssemblySymbol? contextualSymbol, out string? failureReason) 27using var result = PooledArrayBuilder<IAssemblySymbol>.GetInstance(); 34foreach (var assembly in compilation.GetReferencedAssemblySymbols())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
28/// <item>Two <see cref="IAssemblySymbol"/>s are the "same" if 29/// they have equal <see cref="IAssemblySymbol.Identity"/>.Name</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (1)
32if (symbol is not IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
93case IAssemblySymbol assembly:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
700if (assemblyResolution.GetAnySymbol() is IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
335public override void VisitAssembly(IAssemblySymbol assemblySymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (2)
48public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 66var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IAssemblySymbolExtensions.cs (7)
17this List<IAssemblySymbol> assemblies, 22foreach (var a in assemblies) 33public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false) 39foreach (var a in assemblies) 50foreach (var a in assemblies) 63public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
538[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (13)
23if (within is IAssemblySymbol assembly) 42IAssemblySymbol within, 92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 213IAssemblySymbol assembly, 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 219var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 261var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 335IAssemblySymbol withinAssembly, 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.AssemblyComparers.cs (5)
13private sealed class SimpleNameAssemblyComparer : IEqualityComparer<IAssemblySymbol?> 15public static readonly IEqualityComparer<IAssemblySymbol> Instance = new SimpleNameAssemblyComparer(); 17public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 20public int GetHashCode(IAssemblySymbol? obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
50private readonly IEqualityComparer<IAssemblySymbol>? _assemblyComparer; 62IEqualityComparer<IAssemblySymbol>? assemblyComparer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
118SymbolKind.Assembly => AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y), 149private bool AssembliesAreEquivalent(IAssemblySymbol x, IAssemblySymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
63SymbolKind.Assembly => CombineHashCodes((IAssemblySymbol)x, currentHash), 89private int CombineHashCodes(IAssemblySymbol x, int currentHash)
Microsoft.CodeAnalysis.ResxSourceGenerator (59)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (5)
20IAssemblySymbol symbol, int maintainabilityIndex, 31internal static async Task<AssemblyMetricData> ComputeAsync(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 37internal static AssemblyMetricData ComputeSynchronously(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 43private static AssemblyMetricData ComputeFromChildren(IAssemblySymbol assembly, ImmutableArray<CodeAnalysisMetricData> children, CodeMetricsAnalysisContext context) 72private static ImmutableArray<INamespaceOrTypeSymbol> GetChildSymbols(IAssemblySymbol assembly)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
267SymbolKind.Assembly => await AssemblyMetricData.ComputeAsync((IAssemblySymbol)symbol, context).ConfigureAwait(false), 305SymbolKind.Assembly => AssemblyMetricData.ComputeSynchronously((IAssemblySymbol)symbol, context),
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (5)
33_referencedAssemblies = new Lazy<ImmutableArray<IAssemblySymbol>>( 38.Distinct<IAssemblySymbol>(SymbolEqualityComparer.Default) 62private readonly Lazy<ImmutableArray<IAssemblySymbol>> _referencedAssemblies; 72/// so we can query <see cref="IAssemblySymbol.NamespaceNames"/>. 145foreach (IAssemblySymbol? referencedAssembly in _referencedAssemblies.Value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (5)
9private sealed class AssemblySymbolKey : AbstractSymbolKey<IAssemblySymbol> 13public sealed override void Create(IAssemblySymbol symbol, SymbolKeyWriter visitor) 21SymbolKeyReader reader, IAssemblySymbol? contextualSymbol, out string? failureReason) 27using var result = PooledArrayBuilder<IAssemblySymbol>.GetInstance(); 34foreach (var assembly in compilation.GetReferencedAssemblySymbols())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
28/// <item>Two <see cref="IAssemblySymbol"/>s are the "same" if 29/// they have equal <see cref="IAssemblySymbol.Identity"/>.Name</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (1)
32if (symbol is not IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
93case IAssemblySymbol assembly:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
700if (assemblyResolution.GetAnySymbol() is IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
335public override void VisitAssembly(IAssemblySymbol assemblySymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (2)
48public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 66var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IAssemblySymbolExtensions.cs (7)
17this List<IAssemblySymbol> assemblies, 22foreach (var a in assemblies) 33public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false) 39foreach (var a in assemblies) 50foreach (var a in assemblies) 63public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
538[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (13)
23if (within is IAssemblySymbol assembly) 42IAssemblySymbol within, 92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 213IAssemblySymbol assembly, 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 219var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 261var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 335IAssemblySymbol withinAssembly, 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.AssemblyComparers.cs (5)
13private sealed class SimpleNameAssemblyComparer : IEqualityComparer<IAssemblySymbol?> 15public static readonly IEqualityComparer<IAssemblySymbol> Instance = new SimpleNameAssemblyComparer(); 17public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 20public int GetHashCode(IAssemblySymbol? obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
50private readonly IEqualityComparer<IAssemblySymbol>? _assemblyComparer; 62IEqualityComparer<IAssemblySymbol>? assemblyComparer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
118SymbolKind.Assembly => AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y), 149private bool AssembliesAreEquivalent(IAssemblySymbol x, IAssemblySymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
63SymbolKind.Assembly => CombineHashCodes((IAssemblySymbol)x, currentHash), 89private int CombineHashCodes(IAssemblySymbol x, int currentHash)
Microsoft.CodeAnalysis.Test.Utilities (1)
CompilationVerifier.cs (1)
831return ((IAssemblySymbol)symbol).Modules.First();
Microsoft.CodeAnalysis.VisualBasic (19)
Compilation\VisualBasicCompilation.vb (2)
1342Private Protected Overrides Function CommonGetMetadataReference(assemblySymbol As IAssemblySymbol) As MetadataReference 2755Protected Overrides ReadOnly Property CommonAssembly As IAssemblySymbol
SymbolDisplay\SymbolDisplayVisitor.vb (1)
180Public Overrides Sub VisitAssembly(symbol As IAssemblySymbol)
Symbols\AssemblySymbol.vb (13)
85Public Overridable ReadOnly Property IsInteractive As Boolean Implements IAssemblySymbol.IsInteractive 96Public MustOverride Function GetMetadata() As AssemblyMetadata Implements IAssemblySymbol.GetMetadata 101Public MustOverride ReadOnly Property Identity As AssemblyIdentity Implements IAssemblySymbol.Identity, IAssemblySymbolInternal.Identity 474Public MustOverride ReadOnly Property TypeNames As ICollection(Of String) Implements IAssemblySymbol.TypeNames 476Public MustOverride ReadOnly Property NamespaceNames As ICollection(Of String) Implements IAssemblySymbol.NamespaceNames 729Public MustOverride ReadOnly Property MightContainExtensionMethods As Boolean Implements IAssemblySymbol.MightContainExtensionMethods 746Private ReadOnly Property IAssemblySymbol_GlobalNamespace As INamespaceSymbol Implements IAssemblySymbol.GlobalNamespace 752Private Function IAssemblySymbol_GivesAccessTo(assemblyWantingAccess As IAssemblySymbol) As Boolean Implements IAssemblySymbol.GivesAccessTo 783Private ReadOnly Property IAssemblySymbol_Modules As IEnumerable(Of IModuleSymbol) Implements IAssemblySymbol.Modules 789Private Function IAssemblySymbol_ResolveForwardedType(metadataName As String) As INamedTypeSymbol Implements IAssemblySymbol.ResolveForwardedType 793Private Function IAssemblySymbol_GetForwardedTypes() As ImmutableArray(Of INamedTypeSymbol) Implements IAssemblySymbol.GetForwardedTypes 797Private Function IAssemblySymbol_GetTypeByMetadataName(metadataName As String) As INamedTypeSymbol Implements IAssemblySymbol.GetTypeByMetadataName
Symbols\ModuleSymbol.vb (2)
307Private ReadOnly Property IModuleSymbol_ReferencedAssemblySymbols As ImmutableArray(Of IAssemblySymbol) Implements IModuleSymbol.ReferencedAssemblySymbols 309Return ImmutableArray(Of IAssemblySymbol).CastUp(ReferencedAssemblySymbols)
Symbols\Symbol.vb (1)
1188Private ReadOnly Property ISymbol_ContainingAssembly As IAssemblySymbol Implements ISymbol.ContainingAssembly
Microsoft.CodeAnalysis.Workspaces (93)
Editing\SymbolEditor.cs (1)
131private ImmutableArray<ProjectId> GetProjectsForAssembly(IAssemblySymbol assembly)
FindSymbols\Declarations\DeclarationFinder.cs (1)
69AsyncLazy<IAssemblySymbol?> lazyAssembly,
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (2)
122var assemblySymbol = compilation.GetAssemblyOrModuleSymbol(arg.peReference) as IAssemblySymbol;
FindSymbols\FindReferences\DependentProjectsFinder.cs (12)
28/// name of the <see cref="IAssemblySymbol"/> defined by it. 36(IAssemblySymbol assembly, Project? sourceProject, SymbolVisibility visibility), 101/// cref="IAssemblySymbol"/> for both source and metadata symbols, and an optional <see cref="Project"/> if this 104private static Dictionary<IAssemblySymbol, (Project? sourceProject, SymbolVisibility maxVisibility)> GetSymbolOriginations( 107var result = new Dictionary<IAssemblySymbol, (Project? sourceProject, SymbolVisibility visibility)>(); 111var assembly = symbol.OriginalDefinition.ContainingAssembly; 136(IAssemblySymbol assembly, Project? sourceProject) symbolOrigination, 164(IAssemblySymbol assembly, Project? sourceProject) symbolOrigination, 259(IAssemblySymbol assembly, Project? sourceProject) symbolOrigination, 284private static HashSet<string> GetInternalsVisibleToSet(IAssemblySymbol assembly) 307(IAssemblySymbol assembly, Project? sourceProject) symbolOrigination, 372var name = compilation.GetAssemblyOrModuleSymbol(peReference) is IAssemblySymbol { Name: string metadataAssemblyName }
FindSymbols\SymbolFinder_Helpers.cs (1)
174foreach (var assembly in forwardedToCompilation.GetReferencedAssemblySymbols())
FindSymbols\SymbolTree\SymbolTreeInfo.cs (8)
26/// will still incur a heavy cost (for example, getting the <see cref="IAssemblySymbol"/> root symbol for a 120SearchQuery query, IAssemblySymbol assembly, SymbolFilter filter, CancellationToken cancellationToken) 127query, AsyncLazy.Create((IAssemblySymbol?)assembly), filter, cancellationToken); 131SearchQuery query, AsyncLazy<IAssemblySymbol?> lazyAssembly, 144SearchQuery query, AsyncLazy<IAssemblySymbol?> lazyAssembly, CancellationToken cancellationToken) 169AsyncLazy<IAssemblySymbol?> lazyAssembly, string name, CancellationToken cancellationToken) 215AsyncLazy<IAssemblySymbol?> lazyAssembly, 224IAssemblySymbol? assemblySymbol = null;
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (1)
123var assembly = compilation?.Assembly;
Shared\Extensions\INamespaceSymbolExtensions.cs (2)
129IAssemblySymbol assembly) 158IAssemblySymbol assembly,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (5)
9private sealed class AssemblySymbolKey : AbstractSymbolKey<IAssemblySymbol> 13public sealed override void Create(IAssemblySymbol symbol, SymbolKeyWriter visitor) 21SymbolKeyReader reader, IAssemblySymbol? contextualSymbol, out string? failureReason) 27using var result = PooledArrayBuilder<IAssemblySymbol>.GetInstance(); 34foreach (var assembly in compilation.GetReferencedAssemblySymbols())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
28/// <item>Two <see cref="IAssemblySymbol"/>s are the "same" if 29/// they have equal <see cref="IAssemblySymbol.Identity"/>.Name</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (1)
32if (symbol is not IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
93case IAssemblySymbol assembly:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
700if (assemblyResolution.GetAnySymbol() is IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
335public override void VisitAssembly(IAssemblySymbol assemblySymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (2)
48public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 66var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IAssemblySymbolExtensions.cs (7)
17this List<IAssemblySymbol> assemblies, 22foreach (var a in assemblies) 33public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false) 39foreach (var a in assemblies) 50foreach (var a in assemblies) 63public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
538[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (13)
23if (within is IAssemblySymbol assembly) 42IAssemblySymbol within, 92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 213IAssemblySymbol assembly, 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 219var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 261var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 335IAssemblySymbol withinAssembly, 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.AssemblyComparers.cs (5)
13private sealed class SimpleNameAssemblyComparer : IEqualityComparer<IAssemblySymbol?> 15public static readonly IEqualityComparer<IAssemblySymbol> Instance = new SimpleNameAssemblyComparer(); 17public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 20public int GetHashCode(IAssemblySymbol? obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
50private readonly IEqualityComparer<IAssemblySymbol>? _assemblyComparer; 62IEqualityComparer<IAssemblySymbol>? assemblyComparer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
118SymbolKind.Assembly => AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y), 149private bool AssembliesAreEquivalent(IAssemblySymbol x, IAssemblySymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
63SymbolKind.Assembly => CombineHashCodes((IAssemblySymbol)x, currentHash), 89private int CombineHashCodes(IAssemblySymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
425IAssemblySymbol? containingAssembly = null) 444IAssemblySymbol? containingAssembly = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
30IAssemblySymbol containingAssembly, 79public IAssemblySymbol ContainingAssembly { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,
Workspace\Solution\Solution.cs (4)
176public Project? GetProject(IAssemblySymbol assemblySymbol, 189/// This function differs from <see cref="GetProject(IAssemblySymbol, CancellationToken)"/> in terms of how it 190/// treats <see cref="IAssemblySymbol"/>s. Specifically, say there is the following: 198/// symbol than Symbol-A from Project-A. However, <see cref="GetProject(IAssemblySymbol, CancellationToken)"/>
Workspace\Solution\SolutionCompilationState.cs (2)
30/// Symbols need to be either <see cref="IAssemblySymbol"/> or <see cref="IModuleSymbol"/>. 1149public static ProjectId? GetProjectId(IAssemblySymbol? assemblySymbol)
Workspace\Solution\SolutionCompilationState.ICompilationTracker.cs (2)
21/// given <paramref name="symbol"/>. The symbol must be a <see cref="IAssemblySymbol"/>, <see 27/// cref="IAssemblySymbol"/> and <paramref name="primary"/> is <see langword="true"/> then this will only
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
555r => GetProjectId(inProgressCompilationNotRef.GetAssemblyOrModuleSymbol(r) as IAssemblySymbol) == projectReference.ProjectId);
Workspace\Solution\SolutionCompilationState.RootedSymbolSet.cs (1)
56/// The <see cref="IAssemblySymbol"/>s or <see cref="IModuleSymbol"/>s produced through <see
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildWorkspace.cs (2)
646var symbol = compilation.GetAssemblyOrModuleSymbol(metadataReference) as IAssemblySymbol;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (8)
VisualStudioMSBuildWorkspaceTests.cs (8)
1889var sym = (IAssemblySymbol)mtcomp.GetAssemblyOrModuleSymbol(mtref); 1912var sym = (IAssemblySymbol)mtcomp.GetAssemblyOrModuleSymbol(mtref); 1936var sym = (IAssemblySymbol)mtcomp.GetAssemblyOrModuleSymbol(mtref); 1959var sym = (IAssemblySymbol)mtcomp.GetAssemblyOrModuleSymbol(mtref);
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
SolutionTests\SolutionTests.cs (3)
2978var assemblyReference = (IAssemblySymbol)solution.GetProject(project1).GetCompilationAsync().Result.GetAssemblyOrModuleSymbol(mefReference); 2985assemblyReference = (IAssemblySymbol)solution.GetProject(project1).GetCompilationAsync().Result.GetAssemblyOrModuleSymbol(mefReference);
Microsoft.DotNet.ApiCompatibility (73)
ApiComparer.cs (22)
39public IEnumerable<CompatDifference> GetDifferences(IAssemblySymbol left, 40IAssemblySymbol right) 42return GetDifferences(new ElementContainer<IAssemblySymbol>(left, MetadataInformation.DefaultLeft), 43new ElementContainer<IAssemblySymbol>(right, MetadataInformation.DefaultRight)); 47public IEnumerable<CompatDifference> GetDifferences(ElementContainer<IAssemblySymbol> left, 48ElementContainer<IAssemblySymbol> right) 61public IEnumerable<CompatDifference> GetDifferences(IEnumerable<ElementContainer<IAssemblySymbol>> left, 62IEnumerable<ElementContainer<IAssemblySymbol>> right) 75public IEnumerable<CompatDifference> GetDifferences(IEnumerable<IAssemblySymbol> left, 76IEnumerable<IAssemblySymbol> right) 78List<ElementContainer<IAssemblySymbol>> transformedLeft = []; 79foreach (IAssemblySymbol assemblySymbol in left) 81transformedLeft.Add(new ElementContainer<IAssemblySymbol>(assemblySymbol, MetadataInformation.DefaultLeft)); 84List<ElementContainer<IAssemblySymbol>> transformedRight = []; 85foreach (IAssemblySymbol assemblySymbol in right) 87transformedRight.Add(new ElementContainer<IAssemblySymbol>(assemblySymbol, MetadataInformation.DefaultRight)); 94public IEnumerable<CompatDifference> GetDifferences(ElementContainer<IAssemblySymbol> left, 95IReadOnlyList<ElementContainer<IAssemblySymbol>> right) 112public IEnumerable<CompatDifference> GetDifferences(IEnumerable<ElementContainer<IAssemblySymbol>> left, 113IReadOnlyList<IEnumerable<ElementContainer<IAssemblySymbol>>> right) 130IEnumerable<ElementContainer<IAssemblySymbol>> inputMetadata) 135foreach (ElementContainer<IAssemblySymbol> elementContainer in inputMetadata)
Comparing\SymbolEqualityComparer.cs (1)
34if (symbol is IAssemblySymbol assembly)
IApiComparer.cs (12)
25IEnumerable<CompatDifference> GetDifferences(IAssemblySymbol left, IAssemblySymbol right); 34IEnumerable<CompatDifference> GetDifferences(ElementContainer<IAssemblySymbol> left, ElementContainer<IAssemblySymbol> right); 43IEnumerable<CompatDifference> GetDifferences(ElementContainer<IAssemblySymbol> left, IReadOnlyList<ElementContainer<IAssemblySymbol>> right); 52IEnumerable<CompatDifference> GetDifferences(IEnumerable<IAssemblySymbol> left, IEnumerable<IAssemblySymbol> right); 61IEnumerable<CompatDifference> GetDifferences(IEnumerable<ElementContainer<IAssemblySymbol>> left, IEnumerable<ElementContainer<IAssemblySymbol>> right); 70IEnumerable<CompatDifference> GetDifferences(IEnumerable<ElementContainer<IAssemblySymbol>> left, IReadOnlyList<IEnumerable<ElementContainer<IAssemblySymbol>>> right);
Mapping\AssemblyMapper.cs (4)
10/// Object that represents a mapping between multiple <see cref="IAssemblySymbol"/> objects. 21IAssemblySetMapper? containingAssemblySet = null) : ElementMapper<ElementContainer<IAssemblySymbol>>(ruleRunner, settings, rightSetSize), IAssemblyMapper 41void AddOrCreateMappers(ElementContainer<IAssemblySymbol>? assemblyContainer, ElementSide side, int setIndex = 0) 102Dictionary<INamespaceSymbol, List<INamedTypeSymbol>> ResolveTypeForwards(ElementContainer<IAssemblySymbol> assembly,
Mapping\AssemblySetMapper.cs (6)
10/// Object that represents a mapping between two lists of <see cref="IAssemblySymbol"/>. 17int rightSetSize) : ElementMapper<IEnumerable<ElementContainer<IAssemblySymbol>>>(ruleRunner, settings, rightSetSize), IAssemblySetMapper 19private Dictionary<IAssemblySymbol, IAssemblyMapper>? _assemblies; 29_assemblies = new Dictionary<IAssemblySymbol, IAssemblyMapper>(Settings.SymbolEqualityComparer); 37void AddOrCreateMappers(IEnumerable<ElementContainer<IAssemblySymbol>>? assemblyContainers, ElementSide side, int setIndex = 0) 45foreach (ElementContainer<IAssemblySymbol> assemblyContainer in assemblyContainers)
Mapping\IAssemblyMapper.cs (2)
9/// Interface that represents a mapping between multiple <see cref="IAssemblySymbol"/> objects. 13public interface IAssemblyMapper : IElementMapper<ElementContainer<IAssemblySymbol>>
Mapping\IAssemblySetMapper.cs (3)
9/// Interface that represents a mapping between two lists of <see cref="IAssemblySymbol"/>. 11public interface IAssemblySetMapper : IElementMapper<IEnumerable<ElementContainer<IAssemblySymbol>>> 19/// Gets the assembly mappers built from the provided lists of <see cref="IAssemblySymbol"/>.
Rules\AssemblyIdentityMustMatch.cs (2)
33private void RunOnAssemblySymbol(IAssemblySymbol? left, IAssemblySymbol? right, MetadataInformation leftMetadata, MetadataInformation rightMetadata, bool singleAssembly, IList<CompatDifference> differences)
Rules\IRuleRegistrationContext.cs (3)
15/// Registers a callback to invoke when two <see cref="IAssemblySymbol"/> are compared. 18void RegisterOnAssemblySymbolAction(Action<IAssemblySymbol?, IAssemblySymbol?, MetadataInformation, MetadataInformation, bool, IList<CompatDifference>> action);
Rules\IRuleRunnerContext.cs (2)
13void RunOnAssemblySymbolActions(IAssemblySymbol? left, IAssemblySymbol? right, MetadataInformation leftMetadata, MetadataInformation rightMetadata, bool isSingleAssembly, IList<CompatDifference> differences);
Rules\RuleContext.cs (8)
13private readonly List<Action<IAssemblySymbol?, IAssemblySymbol?, MetadataInformation, MetadataInformation, bool, IList<CompatDifference>>> _onAssemblySymbolActions = []; 19public void RegisterOnAssemblySymbolAction(Action<IAssemblySymbol?, IAssemblySymbol?, MetadataInformation, MetadataInformation, bool, IList<CompatDifference>> action) 43public void RunOnAssemblySymbolActions(IAssemblySymbol? left, IAssemblySymbol? right, MetadataInformation leftMetadata, MetadataInformation rightMetadata, bool isSingleAssembly, IList<CompatDifference> differences) 45foreach (Action<IAssemblySymbol?, IAssemblySymbol?, MetadataInformation, MetadataInformation, bool, IList<CompatDifference>> action in _onAssemblySymbolActions)
Runner\ApiCompatRunner.cs (8)
35List<ElementContainer<IAssemblySymbol>> leftContainerList = CreateAssemblySymbols(workItem.Left, out bool resolvedExternallyProvidedAssemblyReferences); 38List<IEnumerable<ElementContainer<IAssemblySymbol>>> rightContainersList = new(workItem.Right.Count); 41List<ElementContainer<IAssemblySymbol>> rightContainers = CreateAssemblySymbols(right.ToImmutableArray(), out resolvedExternallyProvidedAssemblyReferences); 100private List<ElementContainer<IAssemblySymbol>> CreateAssemblySymbols(IReadOnlyList<MetadataInformation> metadataInformation, 112IReadOnlyList<IAssemblySymbol?>? assemblySymbols = null; 127List<ElementContainer<IAssemblySymbol>> elementContainerList = new(metadataInformation.Count); 130IAssemblySymbol? assemblySymbol = assemblySymbols[i]; 139elementContainerList.Add(new ElementContainer<IAssemblySymbol>(assemblySymbol, metadataInformation[i]));
Microsoft.DotNet.ApiCompatibility.Tests (206)
CustomSideNameTests.cs (8)
34IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax, enableNullable); 35IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax, enableNullable); 68ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax, enableNullable), 70ElementContainer<IAssemblySymbol> right = new(SymbolFactory.GetAssemblyFromSyntax(rightSyntax, enableNullable), 107ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax, enableNullable), 109ElementContainer<IAssemblySymbol> right = new(SymbolFactory.GetAssemblyFromSyntax(rightSyntax, enableNullable), 192ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), new MetadataInformation("a.dll", "ref/net6.0/a.dll")); 193IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes);
Mapping\AssemblyMapperTests.cs (2)
66ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 68ElementContainer<IAssemblySymbol> right = new(SymbolFactory.GetAssemblyFromSyntax(rightSyntax),
Mapping\AssemblySetMapperTests.cs (3)
116IReadOnlyList<ElementContainer<IAssemblySymbol>> left = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(leftSyntaxes); 117IReadOnlyList<ElementContainer<IAssemblySymbol>> right1 = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes1); 118IReadOnlyList<ElementContainer<IAssemblySymbol>> right2 = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes2);
Mapping\NamespaceMapperTests.cs (2)
55ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 57ElementContainer<IAssemblySymbol> right = new(SymbolFactory.GetAssemblyFromSyntax(rightSyntax),
Mapping\TypeMapperTests.cs (6)
67ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 69ElementContainer<IAssemblySymbol> right = new(SymbolFactory.GetAssemblyFromSyntax(rightSyntax), 108ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 110ElementContainer<IAssemblySymbol> right = new(SymbolFactory.GetAssemblyFromSyntax(rightSyntax), 148ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 150ElementContainer<IAssemblySymbol> right = new(SymbolFactory.GetAssemblyFromSyntax(rightSyntax),
Rules\AssemblyIdentityMustMatchTests.cs (16)
36IAssemblySymbol left = CSharpCompilation.Create("AssemblyA").Assembly; 37IAssemblySymbol right = CSharpCompilation.Create("AssemblyB").Assembly; 53IAssemblySymbol leftSymbol = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 54IAssemblySymbol rightSymbol = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 73IAssemblySymbol leftSymbol = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 74IAssemblySymbol rightSymbol = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 94IAssemblySymbol leftSymbol = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 95IAssemblySymbol rightSymbol = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 122IAssemblySymbol leftSymbol = SymbolFactory.GetAssemblyFromSyntax(syntax, publicKey: _publicKey); 123IAssemblySymbol rightSymbol = SymbolFactory.GetAssemblyFromSyntax(syntax, publicKey: _publicKey); 142IAssemblySymbol leftSymbol = SymbolFactory.GetAssemblyFromSyntax(syntax); 143IAssemblySymbol rightSymbol = SymbolFactory.GetAssemblyFromSyntax(syntax, publicKey: _publicKey); 170IAssemblySymbol leftSymbol = SymbolFactory.GetAssemblyFromSyntax(syntax, publicKey: _publicKey); 171IAssemblySymbol rightSymbol = SymbolFactory.GetAssemblyFromSyntax(syntax); 200IAssemblySymbol leftSymbol = new AssemblySymbolLoader(s_log).LoadAssembly(leftAssembly); 201IAssemblySymbol rightSymbol = new AssemblySymbolLoader(s_log).LoadAssembly(rightAssembly);
Rules\AttributesMustMatchTests.cs (8)
1329IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 1330IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 1346IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 1347IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 1395IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 1396IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 1445IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 1446IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax);
Rules\CannotAddAbstractMemberTests.cs (10)
20IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 21IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 37IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 38IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 50IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 51IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 66IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 67IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 144ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 146IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes);
Rules\CannotAddMemberToInterfaceTests.cs (8)
43IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 44IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 62IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 63IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 101IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 102IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 183ElementContainer<IAssemblySymbol> left = 185IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes);
Rules\CannotAddOrRemoveVirtualKeywordTests.cs (4)
189IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 190IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 217IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 218IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax);
Rules\CannotChangeGenericConstraintsTests.cs (4)
217IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 218IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 230IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 231IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax);
Rules\CannotChangeVisibilityTests.cs (6)
385IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 386IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 398IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 399IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 413IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 414IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax);
Rules\CannotRemoveBaseTypeOrInterfaceTests.cs (14)
43IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 44IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 72IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 73IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 110IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 111IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 149IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 150IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 203IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 204IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 265ElementContainer<IAssemblySymbol> leftContainer = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 267IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes); 331IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 332IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax);
Rules\CannotSealTypeTests.cs (12)
18IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 19IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 34IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 35IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 67IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 68IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 133ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 135IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes); 188ElementContainer<IAssemblySymbol> leftContainer = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 190IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes); 202IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 203IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax);
Rules\EnumsMustMatchTests.cs (8)
40IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 41IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 79IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 80IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 115IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 116IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 149IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 150IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax);
Rules\MembersMustExistTests.cs (26)
43IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 44IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 97IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 98IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 133IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 134IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 180IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 181IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 223IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax, enableNullable: true); 224IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 255IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 256IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 287IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax, enableNullable: true); 288IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 384ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), new MetadataInformation(string.Empty, "ref")); 385IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes); 423ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 426IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes); 454IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 455IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 492IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 493IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 522IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 523IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 570IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 571IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax);
Rules\MembersMustExistTests.Strict.cs (14)
43IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 44IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 96IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 97IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 132IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 133IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 178IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 179IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 224IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 225IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 320ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 322IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes); 362IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 363IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax);
Rules\ParameterNamesCannotChangeTests.cs (2)
88IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 89IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax);
Rules\TypeMustExistTests.cs (26)
37IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 38IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 72IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax, enableNullable); 73IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax, enableNullable); 101IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax, enableNullable); 102IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax, enableNullable); 136IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntaxWithReferences(leftSyntax, new[] { forwardedTypeSyntax }); 137IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 166IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntaxWithReferences(syntax, references); 167IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntaxWithReferences(syntax, references); 196IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 197IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 230IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 231IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 280IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 281IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 331ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 333IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes); 406ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 408IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes); 444ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 447IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes); 468ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(forwardedTypeSyntax), 471IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes, references); 491ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(forwardedTypeSyntax), 495IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes, references);
Rules\TypeMustExistTests.Strict.cs (18)
36IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax, enableNullable); 37IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax, enableNullable); 75IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 76IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntaxWithReferences(rightSyntax, new[] { forwardedTypeSyntax }); 105IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntaxWithReferences(syntax, references); 106IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntaxWithReferences(syntax, references); 135IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 136IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 175IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 176IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 203IAssemblySymbol left = SymbolFactory.GetAssemblyFromSyntax(leftSyntax); 204IAssemblySymbol right = SymbolFactory.GetAssemblyFromSyntax(rightSyntax); 248ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 250IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes); 313ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 315IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes); 344ElementContainer<IAssemblySymbol> left = new(SymbolFactory.GetAssemblyFromSyntax(leftSyntax), 348IReadOnlyList<ElementContainer<IAssemblySymbol>> right = SymbolFactoryExtensions.GetElementContainersFromSyntaxes(rightSyntaxes, references);
Runner\ApiCompatRunnerTests.cs (3)
21.Setup(y => y.GetDifferences(It.IsAny<ElementContainer<IAssemblySymbol>>(), It.IsAny<IReadOnlyList<ElementContainer<IAssemblySymbol>>>())) 41.Returns(new IAssemblySymbol[]
SymbolFactory.cs (2)
50public static IAssemblySymbol GetAssemblyFromSyntax(string syntax, 63public static IAssemblySymbol GetAssemblyFromSyntaxWithReferences(string syntax,
SymbolFactoryExtensions.cs (4)
14internal static IReadOnlyList<ElementContainer<IAssemblySymbol>> GetElementContainersFromSyntaxes(IEnumerable<string> syntaxes, IEnumerable<string> referencesSyntax = null, bool enableNullable = false, byte[] publicKey = null, [CallerMemberName] string assemblyName = "") 17List<ElementContainer<IAssemblySymbol>> result = new(); 22IAssemblySymbol symbol = referencesSyntax != null ? 26ElementContainer<IAssemblySymbol> container = new(symbol, info);
Microsoft.DotNet.ApiDiff (17)
DiffGeneratorFactory.cs (2)
92Dictionary<string, IAssemblySymbol> beforeAssemblySymbols, 93Dictionary<string, IAssemblySymbol> afterAssemblySymbols,
FileOutputDiffGenerator.cs (2)
97(IAssemblySymbolLoader beforeLoader, Dictionary<string, IAssemblySymbol> beforeAssemblySymbols) = 105(IAssemblySymbolLoader afterLoader, Dictionary<string, IAssemblySymbol> afterAssemblySymbols) =
MemoryOutputDiffGenerator.cs (13)
31private readonly ConcurrentDictionary<string, IAssemblySymbol> _beforeAssemblySymbols; 32private readonly ConcurrentDictionary<string, IAssemblySymbol> _afterAssemblySymbols; 60Dictionary<string, IAssemblySymbol> beforeAssemblySymbols, 61Dictionary<string, IAssemblySymbol> afterAssemblySymbols, 70_beforeAssemblySymbols = new ConcurrentDictionary<string, IAssemblySymbol>(beforeAssemblySymbols); 71_afterAssemblySymbols = new ConcurrentDictionary<string, IAssemblySymbol>(afterAssemblySymbols); 92foreach ((string beforeAssemblyName, IAssemblySymbol beforeAssemblySymbol) in _beforeAssemblySymbols) 101foreach ((string afterAssemblyName, IAssemblySymbol afterAssemblySymbol) in _afterAssemblySymbols) 112private async Task ProcessBeforeAndAfterAssemblyAsync(string beforeAssemblyName, IAssemblySymbol beforeAssemblySymbol) 123if (_afterAssemblySymbols.TryGetValue(beforeAssemblyName, out IAssemblySymbol? afterAssemblySymbol)) 144private async Task ProcessNewAssemblyAsync(string afterAssemblyName, IAssemblySymbol afterAssemblySymbol) 153private async Task<string> ProcessAfterAssemblyAsync(IAssemblySymbol afterAssemblySymbol, SyntaxNode? beforeParentNode = null, SemanticModel? beforeModel = null) 173private async Task<(SyntaxNode rootNode, SemanticModel model)> GetAssemblyRootNodeAndModelAsync(IAssemblySymbolLoader loader, IAssemblySymbol assemblySymbol)
Microsoft.DotNet.ApiDiff.Tests (8)
Diff.Base.Tests.cs (2)
45(IAssemblySymbolLoader beforeLoader, Dictionary<string, IAssemblySymbol> beforeAssemblySymbols) 48(IAssemblySymbolLoader afterLoader, Dictionary<string, IAssemblySymbol> afterAssemblySymbols)
SymbolFactory.cs (2)
50public static IAssemblySymbol GetAssemblyFromSyntax(string syntax, 63public static IAssemblySymbol GetAssemblyFromSyntaxWithReferences(string syntax,
TestAssemblyLoaderFactory.cs (4)
14public static (IAssemblySymbolLoader, Dictionary<string, IAssemblySymbol>) CreateFromTexts( 24new Dictionary<string, IAssemblySymbol>()); 31Dictionary<string, IAssemblySymbol> assemblySymbols = new(); 36if (loader.LoadAssembly(actualAssemblyName, assemblyStream) is IAssemblySymbol assemblySymbol)
Microsoft.DotNet.ApiSymbolExtensions (44)
AssemblySymbolLoader.cs (25)
15/// Loads <see cref="IAssemblySymbol"/> objects from source files, binaries or directories containing binaries. 64public static (AssemblySymbolLoader, Dictionary<string, IAssemblySymbol>) CreateFromFiles( 75new Dictionary<string, IAssemblySymbol>()); 94Dictionary<string, IAssemblySymbol> dictionary = []; 97if (loader._cSharpCompilation.GetAssemblyOrModuleSymbol(metadataReference) is IAssemblySymbol assemblySymbol && 153public IReadOnlyList<IAssemblySymbol?> LoadAssemblies(params string[] paths) 165IAssemblySymbol?[] assemblySymbols = new IAssemblySymbol[assembliesToReturn.Count]; 170assemblySymbols[i] = symbol as IAssemblySymbol; 179public IReadOnlyList<IAssemblySymbol?> LoadAssembliesFromArchive(string archivePath, IReadOnlyList<string> relativePaths) 217IAssemblySymbol?[] assemblySymbols = new IAssemblySymbol[metadataReferences.Length]; 223_cSharpCompilation.GetAssemblyOrModuleSymbol(metadataReference) as IAssemblySymbol : 233public IAssemblySymbol? LoadAssembly(string path) 238IAssemblySymbol? assemblySymbol = _cSharpCompilation.GetAssemblyOrModuleSymbol(metadataReference) as IAssemblySymbol; 245public IAssemblySymbol? LoadAssembly(string name, Stream stream) 260IAssemblySymbol? assemblySymbol = _cSharpCompilation.GetAssemblyOrModuleSymbol(metadataReference) as IAssemblySymbol; 267public IAssemblySymbol LoadAssemblyFromSourceFiles(IEnumerable<string> filePaths, string? assemblyName, IEnumerable<string> referencePaths) 296public IEnumerable<IAssemblySymbol> LoadMatchingAssemblies(IEnumerable<IAssemblySymbol> fromAssemblies, IEnumerable<string> searchPaths, bool validateMatchingIdentity = true, bool warnOnMissingAssemblies = true) 298List<IAssemblySymbol> matchingAssemblies = []; 299foreach (IAssemblySymbol assembly in fromAssemblies) 315if (symbol is IAssemblySymbol matchingAssembly)
IAssemblySymbolLoader.cs (19)
9/// Loads <see cref="IAssemblySymbol"/> objects from source files, binaries or directories containing binaries. 22/// Loads a list of assemblies and gets its corresponding <see cref="IAssemblySymbol"/> from the specified paths. 25/// <returns>The list of resolved <see cref="IAssemblySymbol"/>.</returns> 26IReadOnlyList<IAssemblySymbol?> LoadAssemblies(params string[] paths); 33/// <returns>The list of resolved and unresolved <see cref="IAssemblySymbol"/>.</returns> 34IReadOnlyList<IAssemblySymbol?> LoadAssembliesFromArchive(string archivePath, IReadOnlyList<string> relativePaths); 40/// <returns><see cref="IAssemblySymbol"/> representing the loaded assembly.</returns> 41IAssemblySymbol? LoadAssembly(string path); 48/// <returns><see cref="IAssemblySymbol"/> representing the given <paramref name="stream"/>. If an 50IAssemblySymbol? LoadAssembly(string name, Stream stream); 53/// Loads an <see cref="IAssemblySymbol"/> containing the metadata from the provided source files and given assembly name. 55/// <param name="filePaths">The file paths to use as syntax trees to create the <see cref="IAssemblySymbol"/>.</param> 56/// <param name="assemblyName">The name of the <see cref="IAssemblySymbol"/>.</param> 58/// <returns>The <see cref="IAssemblySymbol"/> containing the metadata from the provided source files.</returns> 59IAssemblySymbol LoadAssemblyFromSourceFiles(IEnumerable<string> filePaths, string assemblyName, IEnumerable<string> referencePaths); 64/// <param name="fromAssemblies">List of <see cref="IAssemblySymbol"/> to search for.</param> 68/// <returns>The list of matching assemblies represented as <see cref="IAssemblySymbol"/>.</returns> 69IEnumerable<IAssemblySymbol> LoadMatchingAssemblies(IEnumerable<IAssemblySymbol> fromAssemblies, IEnumerable<string> searchPaths, bool validateMatchingIdentity = true, bool warnOnMissingAssemblies = true);
Microsoft.DotNet.ApiSymbolExtensions.Tests (16)
AssemblySymbolLoaderTests.cs (13)
115IAssemblySymbol assembly = SymbolFactory.GetAssemblyFromSyntax("namespace MyNamespace { class Foo { } }"); 123IAssemblySymbol assembly = SymbolFactory.GetAssemblyFromSyntax("namespace MyNamespace { class Foo { } }"); 128IEnumerable<IAssemblySymbol> symbols = loader.LoadMatchingAssemblies(new[] { assembly }, paths); 139IAssemblySymbol fromAssembly = SymbolFactory.GetAssemblyFromSyntax(SimpleAssemblySourceContents, assemblyName: assemblyName); 157IEnumerable<IAssemblySymbol> matchingAssemblies = loader.LoadMatchingAssemblies(new[] { fromAssembly }, new[] { outputDirectory }); 169IAssemblySymbol fromAssembly = SymbolFactory.GetAssemblyFromSyntax(SimpleAssemblySourceContents, assemblyName: assetInfo.TestAsset.TestProject.Name); 173IEnumerable<IAssemblySymbol> matchingAssemblies = loader.LoadMatchingAssemblies(new[] { fromAssembly }, new[] { assetInfo.OutputDirectory }, validateMatchingIdentity: validateIdentities); 196IEnumerable<IAssemblySymbol> symbols = loader.LoadAssemblies(assetInfo.OutputDirectory); 215IAssemblySymbol symbol = loader.LoadAssembly(Path.Combine(assetInfo.OutputDirectory, assetInfo.TestAsset.TestProject.Name + ".dll")); 250IEnumerable<IAssemblySymbol> symbols = loader.LoadAssemblies(outputDirectory); 321IAssemblySymbol symbol = loader.LoadAssembly(testProject.Name, stream); 340(AssemblySymbolLoader loader, Dictionary<string, IAssemblySymbol> symbols) = AssemblySymbolLoader.CreateFromFiles( 363(AssemblySymbolLoader loader, Dictionary<string, IAssemblySymbol> symbols) = AssemblySymbolLoader.CreateFromFiles(
SymbolFactory.cs (2)
50public static IAssemblySymbol GetAssemblyFromSyntax(string syntax, 63public static IAssemblySymbol GetAssemblyFromSyntaxWithReferences(string syntax,
SymbolFilterFactoryTests.cs (1)
104IAssemblySymbol assemblySymbol = SymbolFactory.GetAssemblyFromSyntax(@"
Microsoft.DotNet.GenAPI (10)
CSharpAssemblyDocumentGenerator.cs (4)
57public async Task<Document> GetDocumentForAssemblyAsync(IAssemblySymbol assemblySymbol) 255private SyntaxNode GenerateAssemblyAttributes(IAssemblySymbol assembly, SyntaxNode compilationUnit) 292private SyntaxNode GenerateForwardedTypeAssemblyAttributes(IAssemblySymbol assembly, SyntaxNode compilationUnit) 317private static IEnumerable<INamespaceSymbol> EnumerateNamespaces(IAssemblySymbol assemblySymbol)
CSharpFileBuilder.cs (1)
68public void WriteAssembly(IAssemblySymbol assemblySymbol)
GenAPIApp.cs (3)
34(IAssemblySymbolLoader loader, Dictionary<string, IAssemblySymbol> assemblySymbols) = AssemblySymbolLoader.CreateFromFiles( 58Dictionary<string, IAssemblySymbol> assemblySymbols, 74foreach (KeyValuePair<string, IAssemblySymbol> kvp in assemblySymbols)
IAssemblySymbolWriter.cs (2)
16/// <param name="assemblySymbol"><see cref="IAssemblySymbol"/> representing the loaded assembly.</param> 17void WriteAssembly(IAssemblySymbol assemblySymbol);
Microsoft.DotNet.GenAPI.Tests (7)
CSharpFileBuilderTests.cs (1)
43(IAssemblySymbolLoader loader, Dictionary<string, IAssemblySymbol> assemblySymbols) = TestAssemblyLoaderFactory
SymbolFactory.cs (2)
50public static IAssemblySymbol GetAssemblyFromSyntax(string syntax, 63public static IAssemblySymbol GetAssemblyFromSyntaxWithReferences(string syntax,
TestAssemblyLoaderFactory.cs (4)
14public static (IAssemblySymbolLoader, Dictionary<string, IAssemblySymbol>) CreateFromTexts( 24new Dictionary<string, IAssemblySymbol>()); 31Dictionary<string, IAssemblySymbol> assemblySymbols = new(); 36if (loader.LoadAssembly(actualAssemblyName, assemblyStream) is IAssemblySymbol assemblySymbol)
Microsoft.Extensions.Logging.Generators (2)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
51foreach (var referencedAssembly in module.ReferencedAssemblySymbols)
src\libraries\Common\src\Roslyn\SyntaxValueProvider_ForAttributeWithMetadataName.cs (1)
170if (symbol is IAssemblySymbol assemblySymbol)
Microsoft.Extensions.Options.SourceGeneration (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
51foreach (var referencedAssembly in module.ReferencedAssemblySymbols)
Microsoft.Gen.Logging (1)
src\Generators\Shared\RoslynExtensions.cs (1)
62foreach (var referencedAssembly in module.ReferencedAssemblySymbols)
Microsoft.Gen.Metrics (1)
src\Generators\Shared\RoslynExtensions.cs (1)
62foreach (var referencedAssembly in module.ReferencedAssemblySymbols)
Microsoft.Interop.ComInterfaceGenerator (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
51foreach (var referencedAssembly in module.ReferencedAssemblySymbols)
Microsoft.Interop.LibraryImportGenerator (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
51foreach (var referencedAssembly in module.ReferencedAssemblySymbols)
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
51foreach (var referencedAssembly in module.ReferencedAssemblySymbols)
Microsoft.Interop.SourceGeneration (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
51foreach (var referencedAssembly in module.ReferencedAssemblySymbols)
Microsoft.Maui.Controls.SourceGen (6)
CodeBehindGenerator.cs (6)
198 var internalsVisible = new List<IAssemblySymbol>(); 207 if (compilation.GetAssemblyOrModuleSymbol(reference) is not IAssemblySymbol symbol) 583 static bool IsPublicOrVisibleInternal(INamedTypeSymbol type, IEnumerable<IAssemblySymbol> internalsVisible) 758 public static readonly AssemblyCaches Empty = new(Array.Empty<XmlnsDefinitionAttribute>(), Array.Empty<IAssemblySymbol>()); 760 public AssemblyCaches(IReadOnlyList<XmlnsDefinitionAttribute> xmlnsDefinitions, IReadOnlyList<IAssemblySymbol> internalsVisible) 768 public IReadOnlyList<IAssemblySymbol> InternalsVisible { get; }
Microsoft.ML.InternalCodeAnalyzer (3)
BestFriendAnalyzer.cs (3)
62var myAssembly = comp.Assembly; 63var assemblyHasAttrMap = new Dictionary<IAssemblySymbol, bool>(SymbolEqualityComparer.Default); 80var symbolAssembly = symbol.ContainingAssembly;
Microsoft.VisualStudio.LanguageServices (33)
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (2)
44protected void AddAssemblyLink(IAssemblySymbol assemblySymbol) 264if (containingSymbol is IAssemblySymbol assemblySymbol)
Library\ObjectBrowser\AbstractListItemFactory.cs (17)
137private static bool IncludeMemberSymbol(ISymbol symbol, IAssemblySymbol assemblySymbol) 405public void CollectNamespaceListItems(IAssemblySymbol assemblySymbol, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString) 445var assemblySymbol = parentListItem is ReferenceListItem 456private sealed class AssemblySymbolComparer : IEqualityComparer<(ProjectId, IAssemblySymbol)> 458public bool Equals((ProjectId, IAssemblySymbol) x, (ProjectId, IAssemblySymbol) y) 461public int GetHashCode((ProjectId, IAssemblySymbol) obj) 465public async Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync( 496if (compilation.GetAssemblyOrModuleSymbol(reference) is IAssemblySymbol referenceAssembly) 507public async Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync(Project project, bool lookInReferences, CancellationToken cancellationToken) 524if (compilation.GetAssemblyOrModuleSymbol(reference) is IAssemblySymbol referenceAssembly) 535private static bool ContainsAccessibleTypeMember(INamespaceOrTypeSymbol namespaceOrTypeSymbol, IAssemblySymbol assemblySymbol) 548private static ImmutableArray<INamedTypeSymbol> GetAccessibleTypeMembers(INamespaceOrTypeSymbol namespaceOrTypeSymbol, IAssemblySymbol assemblySymbol) 564private static bool IncludeTypeMember(INamedTypeSymbol typeMember, IAssemblySymbol assemblySymbol) 654if (compilation.GetAssemblyOrModuleSymbol(reference) is IAssemblySymbol assemblySymbol) 743public void CollectTypeListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString) 775public void CollectMemberListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString)
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_ListItems.cs (5)
14internal void CollectMemberListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString) 17internal void CollectNamespaceListItems(IAssemblySymbol assemblySymbol, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString) 20internal void CollectTypeListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString) 23internal Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync(Solution solution, string languageName, CancellationToken cancellationToken) 26internal Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync(Project project, bool lookInReferences, CancellationToken cancellationToken)
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_Search.cs (4)
40ImmutableHashSet<(ProjectId, IAssemblySymbol)> projectAndAssemblySet, 58var assemblySymbol = projectIdAndAssembly.Item2; 73var assemblySymbol = projectIdAndAssembly.Item2; 92var assemblySymbol = projectIdAndAssembly.Item2;
Library\ObjectBrowser\Lists\ReferenceListItem.cs (2)
40public IAssemblySymbol GetAssembly(Compilation compilation) 41=> compilation.GetAssemblyOrModuleSymbol(MetadataReference) as IAssemblySymbol;
Library\VsNavInfo\NavInfoFactory.cs (3)
38case IAssemblySymbol assemblySymbol: 60public IVsNavInfo CreateForAssembly(IAssemblySymbol assemblySymbol) 128private IVsNavInfo Create(IAssemblySymbol containingAssembly, Project project, Compilation compilation, bool useExpandedHierarchy = false,
Microsoft.VisualStudio.LanguageServices.Implementation (2)
CodeModel\Collections\ExternalNamespaceEnumerator.cs (1)
72var containingAssembly = project.GetCompilationAsync().Result.Assembly;
CodeModel\ExternalElements\AbstractExternalCodeType.cs (1)
38var assembly = type.ContainingAssembly;
Roslyn.Diagnostics.Analyzers (68)
AbstractDoNotCopyValue.cs (1)
256public override void VisitAssembly(IAssemblySymbol symbol)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (5)
20IAssemblySymbol symbol, int maintainabilityIndex, 31internal static async Task<AssemblyMetricData> ComputeAsync(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 37internal static AssemblyMetricData ComputeSynchronously(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 43private static AssemblyMetricData ComputeFromChildren(IAssemblySymbol assembly, ImmutableArray<CodeAnalysisMetricData> children, CodeMetricsAnalysisContext context) 72private static ImmutableArray<INamespaceOrTypeSymbol> GetChildSymbols(IAssemblySymbol assembly)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
267SymbolKind.Assembly => await AssemblyMetricData.ComputeAsync((IAssemblySymbol)symbol, context).ConfigureAwait(false), 305SymbolKind.Assembly => AssemblyMetricData.ComputeSynchronously((IAssemblySymbol)symbol, context),
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (5)
33_referencedAssemblies = new Lazy<ImmutableArray<IAssemblySymbol>>( 38.Distinct<IAssemblySymbol>(SymbolEqualityComparer.Default) 62private readonly Lazy<ImmutableArray<IAssemblySymbol>> _referencedAssemblies; 72/// so we can query <see cref="IAssemblySymbol.NamespaceNames"/>. 145foreach (IAssemblySymbol? referencedAssembly in _referencedAssemblies.Value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (5)
9private sealed class AssemblySymbolKey : AbstractSymbolKey<IAssemblySymbol> 13public sealed override void Create(IAssemblySymbol symbol, SymbolKeyWriter visitor) 21SymbolKeyReader reader, IAssemblySymbol? contextualSymbol, out string? failureReason) 27using var result = PooledArrayBuilder<IAssemblySymbol>.GetInstance(); 34foreach (var assembly in compilation.GetReferencedAssemblySymbols())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
28/// <item>Two <see cref="IAssemblySymbol"/>s are the "same" if 29/// they have equal <see cref="IAssemblySymbol.Identity"/>.Name</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (1)
32if (symbol is not IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
93case IAssemblySymbol assembly:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
700if (assemblyResolution.GetAnySymbol() is IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
335public override void VisitAssembly(IAssemblySymbol assemblySymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (2)
48public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 66var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IAssemblySymbolExtensions.cs (7)
17this List<IAssemblySymbol> assemblies, 22foreach (var a in assemblies) 33public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false) 39foreach (var a in assemblies) 50foreach (var a in assemblies) 63public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
538[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (13)
23if (within is IAssemblySymbol assembly) 42IAssemblySymbol within, 92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 213IAssemblySymbol assembly, 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 219var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 261var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 335IAssemblySymbol withinAssembly, 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.AssemblyComparers.cs (5)
13private sealed class SimpleNameAssemblyComparer : IEqualityComparer<IAssemblySymbol?> 15public static readonly IEqualityComparer<IAssemblySymbol> Instance = new SimpleNameAssemblyComparer(); 17public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 20public int GetHashCode(IAssemblySymbol? obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
50private readonly IEqualityComparer<IAssemblySymbol>? _assemblyComparer; 62IEqualityComparer<IAssemblySymbol>? assemblyComparer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
118SymbolKind.Assembly => AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y), 149private bool AssembliesAreEquivalent(IAssemblySymbol x, IAssemblySymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
63SymbolKind.Assembly => CombineHashCodes((IAssemblySymbol)x, currentHash), 89private int CombineHashCodes(IAssemblySymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
425IAssemblySymbol? containingAssembly = null) 444IAssemblySymbol? containingAssembly = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
30IAssemblySymbol containingAssembly, 79public IAssemblySymbol ContainingAssembly { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
50private static INamespaceSymbol GetNamespace(IAssemblySymbol assembly, params string[] namespaceNames)
System.Text.Json.SourceGeneration (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
51foreach (var referencedAssembly in module.ReferencedAssemblySymbols)
System.Text.RegularExpressions.Generator (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
51foreach (var referencedAssembly in module.ReferencedAssemblySymbols)
Test.Utilities (6)
WellKnownTypeProvider.cs (6)
30_referencedAssemblies = new Lazy<ImmutableArray<IAssemblySymbol>>( 35.Distinct<IAssemblySymbol>(SymbolEqualityComparer.Default) 59private readonly Lazy<ImmutableArray<IAssemblySymbol>> _referencedAssemblies; 108var corLib = Compilation.ObjectType.ContainingAssembly; 115foreach (var referencedAssembly in Compilation.SourceModule.ReferencedAssemblySymbols) 198foreach (IAssemblySymbol? referencedAssembly in _referencedAssemblies.Value)
Text.Analyzers (68)
IdentifiersShouldBeSpelledCorrectly.cs (1)
298var assembly = context.Compilation.Assembly;
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (5)
20IAssemblySymbol symbol, int maintainabilityIndex, 31internal static async Task<AssemblyMetricData> ComputeAsync(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 37internal static AssemblyMetricData ComputeSynchronously(IAssemblySymbol assembly, CodeMetricsAnalysisContext context) 43private static AssemblyMetricData ComputeFromChildren(IAssemblySymbol assembly, ImmutableArray<CodeAnalysisMetricData> children, CodeMetricsAnalysisContext context) 72private static ImmutableArray<INamespaceOrTypeSymbol> GetChildSymbols(IAssemblySymbol assembly)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
267SymbolKind.Assembly => await AssemblyMetricData.ComputeAsync((IAssemblySymbol)symbol, context).ConfigureAwait(false), 305SymbolKind.Assembly => AssemblyMetricData.ComputeSynchronously((IAssemblySymbol)symbol, context),
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (5)
33_referencedAssemblies = new Lazy<ImmutableArray<IAssemblySymbol>>( 38.Distinct<IAssemblySymbol>(SymbolEqualityComparer.Default) 62private readonly Lazy<ImmutableArray<IAssemblySymbol>> _referencedAssemblies; 72/// so we can query <see cref="IAssemblySymbol.NamespaceNames"/>. 145foreach (IAssemblySymbol? referencedAssembly in _referencedAssemblies.Value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (5)
9private sealed class AssemblySymbolKey : AbstractSymbolKey<IAssemblySymbol> 13public sealed override void Create(IAssemblySymbol symbol, SymbolKeyWriter visitor) 21SymbolKeyReader reader, IAssemblySymbol? contextualSymbol, out string? failureReason) 27using var result = PooledArrayBuilder<IAssemblySymbol>.GetInstance(); 34foreach (var assembly in compilation.GetReferencedAssemblySymbols())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
28/// <item>Two <see cref="IAssemblySymbol"/>s are the "same" if 29/// they have equal <see cref="IAssemblySymbol.Identity"/>.Name</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ModuleSymbolKey.cs (1)
32if (symbol is not IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
93case IAssemblySymbol assembly:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
700if (assemblyResolution.GetAnySymbol() is IAssemblySymbol assembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
335public override void VisitAssembly(IAssemblySymbol assemblySymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (2)
48public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 66var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IAssemblySymbolExtensions.cs (7)
17this List<IAssemblySymbol> assemblies, 22foreach (var a in assemblies) 33public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false) 39foreach (var a in assemblies) 50foreach (var a in assemblies) 63public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
538[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (13)
23if (within is IAssemblySymbol assembly) 42IAssemblySymbol within, 92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 213IAssemblySymbol assembly, 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 219var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 261var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; 335IAssemblySymbol withinAssembly, 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.AssemblyComparers.cs (5)
13private sealed class SimpleNameAssemblyComparer : IEqualityComparer<IAssemblySymbol?> 15public static readonly IEqualityComparer<IAssemblySymbol> Instance = new SimpleNameAssemblyComparer(); 17public bool Equals(IAssemblySymbol? x, IAssemblySymbol? y) 20public int GetHashCode(IAssemblySymbol? obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
50private readonly IEqualityComparer<IAssemblySymbol>? _assemblyComparer; 62IEqualityComparer<IAssemblySymbol>? assemblyComparer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
118SymbolKind.Assembly => AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y), 149private bool AssembliesAreEquivalent(IAssemblySymbol x, IAssemblySymbol y)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
63SymbolKind.Assembly => CombineHashCodes((IAssemblySymbol)x, currentHash), 89private int CombineHashCodes(IAssemblySymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
425IAssemblySymbol? containingAssembly = null) 444IAssemblySymbol? containingAssembly = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
23IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
30IAssemblySymbol containingAssembly, 79public IAssemblySymbol ContainingAssembly { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
13IAssemblySymbol containingAssembly,