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