10 instantiations of ReferenceInfo
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
UnusedReferences\ProjectAssets\ProjectAssetsReaderTests.cs (2)
69=> new(ReferenceType.Project, projectPath, treatAsUsed, ImmutableArray.Create(Path.ChangeExtension(projectPath, "dll")), dependencies.ToImmutableArray()); 73=> new(ReferenceType.Package, Path.GetFileNameWithoutExtension(assemblyPath), treatAsUsed, ImmutableArray.Create(assemblyPath), dependencies.ToImmutableArray());
UnusedReferences\UnusedReferencesRemoverTests.cs (4)
111var analyzerReference = new ReferenceInfo( 183=> new(ReferenceType.Project, 192=> new(ReferenceType.Package, 201=> new(ReferenceType.Assembly,
Microsoft.CodeAnalysis.Features (3)
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (1)
178var reference = new ReferenceInfo(referenceType, itemSpecification, treatAsUsed, compilationAssemblies.ToImmutable(), dependencies);
UnusedReferences\ReferenceInfo.cs (2)
57=> new(ReferenceType, itemSpecification, TreatAsUsed, CompilationAssemblies, Dependencies); 60=> new(ReferenceType, ItemSpecification, TreatAsUsed, CompilationAssemblies, dependencies.AsImmutableOrEmpty());
Microsoft.VisualStudio.LanguageServices (1)
UnusedReferences\UnusedReferenceExtensions.cs (1)
16return new ReferenceInfo(
112 references to ReferenceInfo
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (48)
UnusedReferences\ProjectAssets\ProjectAssetsReaderTests.cs (12)
28var myPackage = PackageReference("MyPackage.dll"); 38var myPackage = PackageReference("MyPackage.dll"); 42var realizedReference = Assert.Single(realizedReferences); 63var realizedReference = Assert.Single(realizedReferences); 67private static ReferenceInfo ProjectReference(string projectPath, params ReferenceInfo[] dependencies) => ProjectReference(projectPath, false, dependencies); 68private static ReferenceInfo ProjectReference(string projectPath, bool treatAsUsed, params ReferenceInfo[] dependencies) 71private static ReferenceInfo PackageReference(string assemblyPath, params ReferenceInfo[] dependencies) => PackageReference(assemblyPath, false, dependencies); 72private static ReferenceInfo PackageReference(string assemblyPath, bool treatAsUsed, params ReferenceInfo[] dependencies)
UnusedReferences\ProjectAssets\TestProjectAssetsFile.cs (12)
16public static ProjectAssetsFile Create(int version, string targetFramework, ImmutableArray<ReferenceInfo> references) 18var allReferences = new List<ReferenceInfo>(); 35private static void FlattenReferences(ImmutableArray<ReferenceInfo> references, List<ReferenceInfo> allReferences) 37foreach (var reference in references) 41private static void FlattenReference(ReferenceInfo reference, List<ReferenceInfo> allReferences) 47private static Dictionary<string, ProjectAssetsLibrary> BuildLibraries(List<ReferenceInfo> references) 50foreach (var reference in references) 59private static Dictionary<string, Dictionary<string, ProjectAssetsTargetLibrary>> BuildTargets(string targetFramework, List<ReferenceInfo> references) 62foreach (var reference in references) 87private static Dictionary<string, string> BuildDependencies(ImmutableArray<ReferenceInfo> references)
UnusedReferences\UnusedReferencesRemoverTests.cs (24)
31var usedReference = AssemblyReference(UsedAssemblyPath); 42var usedReference = PackageReference(UsedAssemblyPath); 53var usedReference = ProjectReference(UsedAssemblyName); 64var unusedReference = PackageReference(UnusedAssemblyPath); 76var transitivelyUsedReference = PackageReference(UnusedAssemblyName, PackageReference(UsedAssemblyPath)); 87var transitivelyUsedReference = ProjectReference(UnusedAssemblyName, PackageReference(UsedAssemblyPath)); 98var transitivelyUsedReference = ProjectReference(UnusedAssemblyPath, PackageReference(UsedAssemblyPath)); 99var directlyUsedReference = PackageReference(UsedAssemblyPath); 111var analyzerReference = new ReferenceInfo( 116dependencies: ImmutableArray<ReferenceInfo>.Empty); 164private static ImmutableArray<ReferenceInfo> GetUnusedReferences(string[] usedCompilationAssemblies, string[] usedProjectAssemblyNames, params ReferenceInfo[] references) 180private static ReferenceInfo ProjectReference(string assemblyPath, params ReferenceInfo[] dependencies) 182private static ReferenceInfo ProjectReference(string assemblyPath, bool treatAsUsed, params ReferenceInfo[] dependencies) 189private static ReferenceInfo PackageReference(string assemblyPath, params ReferenceInfo[] dependencies) 191private static ReferenceInfo PackageReference(string assemblyPath, bool treatAsUsed, params ReferenceInfo[] dependencies) 198private static ReferenceInfo AssemblyReference(string assemblyPath) 200private static ReferenceInfo AssemblyReference(string assemblyPath, bool treatAsUsed) 205dependencies: ImmutableArray<ReferenceInfo>.Empty); 212public Task<ImmutableArray<ReferenceInfo>> GetProjectReferencesAsync(string projectPath, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features (44)
UnusedReferences\IReferenceCleanupService.cs (1)
18Task<ImmutableArray<ReferenceInfo>> GetProjectReferencesAsync(
UnusedReferences\IUnusedReferenceAnalysisService.cs (4)
15Task<ImmutableArray<ReferenceInfo>> GetUnusedReferencesAsync( 19ImmutableArray<ReferenceInfo> projectReferences, 25ValueTask<ImmutableArray<ReferenceInfo>> GetUnusedReferencesAsync( 29ImmutableArray<ReferenceInfo> projectReferences,
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (14)
23public static ImmutableArray<ReferenceInfo> AddDependencyHierarchies( 24ImmutableArray<ReferenceInfo> projectReferences, 30return ImmutableArray<ReferenceInfo>.Empty; 36return ImmutableArray<ReferenceInfo>.Empty; 42return ImmutableArray<ReferenceInfo>.Empty; 59var builtReferences = new Dictionary<string, ReferenceInfo?>(); 69private static ReferenceInfo? EnhanceReference( 71ReferenceInfo referenceInfo, 74Dictionary<string, ReferenceInfo?> builtReferences) 85var reference = BuildReference(projectAssets, referenceName, referenceInfo.TreatAsUsed, targetLibraryKeys, builtReferences); 94private static ReferenceInfo? BuildReference( 99Dictionary<string, ReferenceInfo?> builtReferences) 168if (builtReferences.TryGetValue(itemSpecification, out var builtReference)) 178var reference = new ReferenceInfo(referenceType, itemSpecification, treatAsUsed, compilationAssemblies.ToImmutable(), dependencies);
UnusedReferences\ReferenceInfo.cs (5)
45public ImmutableArray<ReferenceInfo> Dependencies { get; } 47public ReferenceInfo(ReferenceType referenceType, string itemSpecification, bool treatAsUsed, ImmutableArray<string> compilationAssemblies, ImmutableArray<ReferenceInfo> dependencies) 56public ReferenceInfo WithItemSpecification(string itemSpecification) 59public ReferenceInfo WithDependencies(IEnumerable<ReferenceInfo>? dependencies)
UnusedReferences\ReferenceUpdate.cs (2)
17public ReferenceInfo ReferenceInfo { get; } 19public ReferenceUpdate(UpdateAction action, ReferenceInfo referenceInfo)
UnusedReferences\UnusedReferencesRemover.cs (18)
27public static async Task<ImmutableArray<ReferenceInfo>> GetUnusedReferencesAsync( 30ImmutableArray<ReferenceInfo> references, 66internal static ImmutableArray<ReferenceInfo> GetUnusedReferences( 69ImmutableArray<ReferenceInfo> references) 71var unusedReferencesBuilder = ImmutableArray.CreateBuilder<ReferenceInfo>(); 130private static ImmutableArray<ReferenceInfo> RemoveDirectlyUsedReferences( 131ImmutableArray<ReferenceInfo> references, 141var unusedReferencesBuilder = ImmutableArray.CreateBuilder<ReferenceInfo>(); 143foreach (var reference in references) 186private static ImmutableArray<ReferenceInfo> RemoveTransitivelyUsedReferences( 187ImmutableArray<ReferenceInfo> references, 200var unusedReferencesBuilder = ImmutableArray.CreateBuilder<ReferenceInfo>(); 202foreach (var reference in references) 228internal static bool HasAnyCompilationAssembly(ReferenceInfo reference) 238internal static bool ContainsAnyCompilationAssembly(ReferenceInfo reference, HashSet<string> usedAssemblyFilePaths) 248internal static void RemoveAllCompilationAssemblies(ReferenceInfo reference, HashSet<string> usedAssemblyFilePaths) 252foreach (var dependency in reference.Dependencies) 258internal static ImmutableArray<string> GetAllCompilationAssemblies(ReferenceInfo reference)
Microsoft.CodeAnalysis.Remote.ServiceHub (7)
ProjectAssetsFileReader.cs (5)
18public static async Task<ImmutableArray<ReferenceInfo>> ReadReferencesAsync( 19ImmutableArray<ReferenceInfo> projectReferences, 25return ImmutableArray<ReferenceInfo>.Empty; 37return ImmutableArray<ReferenceInfo>.Empty; 47return ImmutableArray<ReferenceInfo>.Empty;
Services\UnusedReferences\RemoteUnusedReferenceAnalysisService.cs (2)
26public ValueTask<ImmutableArray<ReferenceInfo>> GetUnusedReferencesAsync(Checksum solutionChecksum, string projectFilePath, string projectAssetsFilePath, ImmutableArray<ReferenceInfo> projectReferences, CancellationToken cancellationToken)
Microsoft.VisualStudio.LanguageServices (13)
UnusedReferences\ProjectAssets\ProjectAssetsFileReader.cs (5)
18public static async Task<ImmutableArray<ReferenceInfo>> ReadReferencesAsync( 19ImmutableArray<ReferenceInfo> projectReferences, 25return ImmutableArray<ReferenceInfo>.Empty; 37return ImmutableArray<ReferenceInfo>.Empty; 47return ImmutableArray<ReferenceInfo>.Empty;
UnusedReferences\UnusedReferenceAnalysisService.cs (4)
26public async Task<ImmutableArray<ReferenceInfo>> GetUnusedReferencesAsync(Solution solution, string projectFilePath, string projectAssetsFilePath, ImmutableArray<ReferenceInfo> projectReferences, CancellationToken cancellationToken) 32var result = await client.TryInvokeAsync<IRemoteUnusedReferenceAnalysisService, ImmutableArray<ReferenceInfo>>( 39return ImmutableArray<ReferenceInfo>.Empty;
UnusedReferences\UnusedReferenceExtensions.cs (3)
14public static ReferenceInfo ToReferenceInfo(this ProjectSystemReferenceInfo projectSystemReference) 21ImmutableArray<ReferenceInfo>.Empty); 38public static ProjectSystemReferenceInfo ToProjectSystemReferenceInfo(this ReferenceInfo reference)
UnusedReferences\VisualStudioReferenceCleanupService.cs (1)
32public async Task<ImmutableArray<ReferenceInfo>> GetProjectReferencesAsync(string projectPath, CancellationToken cancellationToken)