11 types derived from AnalyzerReference
Microsoft.CodeAnalysis (4)
DiagnosticAnalyzer\AnalyzerFileReference.cs (2)
32public sealed class AnalyzerFileReference : AnalyzerReference, IEquatable<AnalyzerReference>
DiagnosticAnalyzer\AnalyzerImageReference.cs (1)
17public sealed class AnalyzerImageReference : AnalyzerReference
DiagnosticAnalyzer\UnresolvedAnalyzerReference.cs (1)
16public sealed class UnresolvedAnalyzerReference : AnalyzerReference
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeFixes\CodeFixServiceTests.cs (1)
446private class MockAnalyzerReference : AnalyzerReference, ICodeFixProviderFactory
CodeRefactorings\CodeRefactoringServiceTest.cs (1)
129private class StubAnalyzerReference : AnalyzerReference, ICodeRefactoringProviderFactory
Completion\CompletionServiceTests.cs (1)
73private class MockAnalyzerReference : AnalyzerReference, ICompletionProviderFactory
Microsoft.CodeAnalysis.Test.Utilities (1)
Mocks\TestAnalyzerReference.cs (1)
11internal class TestAnalyzerReference : AnalyzerReference
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
TestAnalyzerReferenceByLanguage.cs (1)
13internal class TestAnalyzerReferenceByLanguage : AnalyzerReference
TestGeneratorReference.cs (1)
16public class TestGeneratorReference : AnalyzerReference
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
EditorConfigSettings\DataProvider\DataProviderTests.MockAnalyzerReference.cs (1)
16private class MockAnalyzerReference : AnalyzerReference
272 references to AnalyzerReference
AnalyzerRunner (1)
Program.cs (1)
142solution = solution.WithProjectAnalyzerReferences(projectId, ImmutableArray<AnalyzerReference>.Empty);
Microsoft.CodeAnalysis (3)
CommandLine\CommandLineArguments.cs (2)
461public IEnumerable<AnalyzerReference> ResolveAnalyzerReferences(IAnalyzerAssemblyLoader analyzerLoader) 466?? (AnalyzerReference)new UnresolvedAnalyzerReference(cmdLineReference.FilePath);
DiagnosticAnalyzer\AnalyzerFileReference.cs (1)
86public bool Equals(AnalyzerReference? other)
Microsoft.CodeAnalysis.EditorFeatures (4)
EditorConfigSettings\DataProvider\Analyzer\AnalyzerSettingsProvider.cs (2)
32foreach (var analyzerReference in analyzerReferences) 39private IEnumerable<AnalyzerSetting> GetSettings(AnalyzerReference analyzerReference, AnalyzerConfigOptions editorConfigOptions)
Preview\AbstractPreviewFactoryService.cs (2)
184foreach (var analyzer in projectChanges.GetAddedAnalyzerReferences()) 191foreach (var analyzer in projectChanges.GetRemovedAnalyzerReferences())
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (6)
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
430protected static async Task<AnalyzerReference> AddGeneratorAsync(ISourceGenerator generator, EditorTestWorkspace workspace) 444protected static async Task RemoveGeneratorAsync(AnalyzerReference reference, EditorTestWorkspace workspace)
Workspaces\EditorTestHostProject.cs (3)
27IList<AnalyzerReference>? analyzerReferences = null, 58IEnumerable<AnalyzerReference>? analyzerReferences = null, 86IEnumerable<AnalyzerReference>? analyzerReferences = null,
Workspaces\EditorTestWorkspace.cs (1)
89IList<AnalyzerReference>? analyzerReferences = null,
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (6)
CodeFixes\CodeFixServiceTests.vb (2)
88Dim projectAnalyzerReferences = ImmutableArray.Create(Of AnalyzerReference)(projectAnalyzerReference) 160Dim projectAnalyzerReferences = ImmutableArray.Create(Of AnalyzerReference)(projectAnalyzerReference)
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (1)
136Dim analyzeReferences As AnalyzerReference()
Diagnostics\DiagnosticServiceTests.vb (3)
111Dim projectAnalyzerReferences1 = ImmutableArray.Create(Of AnalyzerReference)(projectAnalyzerReference1) 203Dim projectAnalyzerReferences1 = ImmutableArray.Create(Of AnalyzerReference)(projectAnalyzerReference1) 244project = project.WithAnalyzerReferences(ImmutableArray.Create(Of AnalyzerReference)(projectAnalyzerReference))
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (3)
EmbeddedLanguages\BraceMatching\AspNetCoreBraceMatcherExtensionProvider.cs (1)
20protected override bool TryGetExtensionsFromReference(AnalyzerReference reference, out ImmutableArray<IAspNetCoreEmbeddedLanguageBraceMatcher> extensions)
EmbeddedLanguages\Classification\AspNetCoreClassifierExtensionProvider.cs (1)
20protected override bool TryGetExtensionsFromReference(AnalyzerReference reference, out ImmutableArray<IAspNetCoreEmbeddedLanguageClassifier> extensions)
EmbeddedLanguages\DocumentHighlighting\AspNetCoreClassifierExtensionProvider.cs (1)
20protected override bool TryGetExtensionsFromReference(AnalyzerReference reference, out ImmutableArray<IAspNetCoreEmbeddedLanguageDocumentHighlighter> extensions)
Microsoft.CodeAnalysis.Features (16)
CodeRefactorings\CodeRefactoringService.cs (1)
259protected override bool TryGetExtensionsFromReference(AnalyzerReference reference, out ImmutableArray<CodeRefactoringProvider> extensions)
Common\AbstractProjectExtensionProvider.cs (10)
25private static readonly ConditionalWeakTable<IReadOnlyList<AnalyzerReference>, StrongBox<ImmutableArray<TExtension>>> s_referencesToExtensionsMap = new(); 26private static readonly ConditionalWeakTable<AnalyzerReference, TProvider> s_referenceToProviderMap = new(); 29private AnalyzerReference Reference { get; init; } = null!; 33protected abstract bool TryGetExtensionsFromReference(AnalyzerReference reference, out ImmutableArray<TExtension> extensions); 35public static bool TryGetCachedExtensions(IReadOnlyList<AnalyzerReference> analyzerReferences, out ImmutableArray<TExtension> extensions) 55public static ImmutableArray<TExtension> GetExtensions(string language, IReadOnlyList<AnalyzerReference> analyzerReferences) 62static ImmutableArray<TExtension> GetExtensionsSlow(string language, IReadOnlyList<AnalyzerReference> analyzerReferences) 65static ImmutableArray<TExtension> ComputeExtensions(string language, IReadOnlyList<AnalyzerReference> analyzerReferences) 68foreach (var reference in analyzerReferences) 189static AnalyzerFileReference? GetAnalyzerFileReference(AnalyzerReference reference)
Completion\CompletionService.ProviderManager.cs (5)
33private readonly AsyncBatchingWorkQueue<IReadOnlyList<AnalyzerReference>> _projectProvidersWorkQueue; 41_projectProvidersWorkQueue = new AsyncBatchingWorkQueue<IReadOnlyList<AnalyzerReference>>( 44EqualityComparer<IReadOnlyList<AnalyzerReference>>.Default, 83private ValueTask ProcessBatchAsync(ImmutableSegmentedList<IReadOnlyList<AnalyzerReference>> referencesList, CancellationToken cancellationToken) 262protected override bool TryGetExtensionsFromReference(AnalyzerReference reference, out ImmutableArray<CompletionProvider> extensions)
Microsoft.CodeAnalysis.LanguageServer.Protocol (10)
Features\CodeFixes\CodeFixService.cs (1)
46private readonly ConditionalWeakTable<IReadOnlyList<AnalyzerReference>, ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>> _projectFixersMap = new();
Features\CodeFixes\CodeFixService.ProjectCodeFixProvider.cs (1)
18protected override bool TryGetExtensionsFromReference(AnalyzerReference reference, out ImmutableArray<CodeFixProvider> extensions)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ProjectAnalyzerReferenceChangedEventArgs.cs (1)
15/// this event args contains information such as <see cref="Project"/> the <see cref="AnalyzerReference"/> has changed
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.cs (2)
190public HostAnalyzerStateSetKey(string language, bool hasSdkCodeStyleAnalyzers, IReadOnlyList<AnalyzerReference> analyzerReferences) 199public IReadOnlyList<AnalyzerReference> AnalyzerReferences { get; }
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.HostStates.cs (1)
97foreach (var analyzerReference in hostAnalyzers.HostAnalyzerReferences)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.ProjectStates.cs (4)
27public readonly IReadOnlyList<AnalyzerReference> AnalyzerReferences; 37IReadOnlyList<AnalyzerReference> analyzerReferences, 158IEnumerable<AnalyzerReference> references, 169foreach (var reference in references)
Microsoft.CodeAnalysis.Remote.ServiceHub (10)
Host\AssetProvider.cs (2)
107tasks.Add(this.GetAssetsAsync<AnalyzerReference>( 199tasks.Add(SynchronizeProjectAssetCollectionAsync<AnalyzerReference>(new(AssetPathKind.ProjectAnalyzerReferences, projectId), static p => p.AnalyzerReferences));
Host\RemoteWorkspace.SolutionCreator.cs (2)
73var deserializedAnalyzerReferences = await _assetProvider.GetAssetsArrayAsync<AnalyzerReference>( 381var deserializedAnalyzerReferences = await _assetProvider.GetAssetsArrayAsync<AnalyzerReference>(
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (3)
564foreach (var reference in _project.Solution.AnalyzerReferences) 589foreach (var reference in _project.AnalyzerReferences) 609static bool ShouldRedirectAnalyzers(Project project, AnalyzerReference reference)
Services\SourceGeneration\RemoteSourceGenerationService.cs (3)
23using AnalyzerReferenceMap = ConditionalWeakTable<AnalyzerReference, StrongBox<bool>>; 83AnalyzerReference analyzerReference, string language) 125() => assetProvider.GetAssetsArrayAsync<AnalyzerReference>(projectId, checksumCollection, cancellationToken),
Microsoft.CodeAnalysis.Remote.Workspaces (2)
AbstractAssetProvider.cs (2)
56var analyzerReference = await this.GetAssetsArrayAsync<AnalyzerReference>( 92var analyzerReferencesTask = this.GetAssetsArrayAsync<AnalyzerReference>(new(AssetPathKind.ProjectAnalyzerReferences, projectId), projectChecksums.AnalyzerReferences, cancellationToken);
Microsoft.CodeAnalysis.Test.Utilities (3)
Diagnostics\DiagnosticExtensions.cs (3)
409public static AnalyzerReference GetCompilerDiagnosticAnalyzerReference(string languageName) 415public static ImmutableDictionary<string, ImmutableArray<AnalyzerReference>> GetCompilerDiagnosticAnalyzerReferencesMap() 417var builder = ImmutableDictionary.CreateBuilder<string, ImmutableArray<AnalyzerReference>>();
Microsoft.CodeAnalysis.UnitTests (3)
Analyzers\AnalyzerFileReferenceTests.cs (3)
88Assert.True(refA.Equals((AnalyzerReference)refA)); 89Assert.False(refA.Equals((AnalyzerReference?)null)); 90Assert.True(refA!.Equals((AnalyzerReference)refB));
Microsoft.CodeAnalysis.Workspaces (148)
Diagnostics\DiagnosticAnalyzerInfoCache.cs (1)
19/// Provides and caches information about diagnostic analyzers such as <see cref="AnalyzerReference"/>,
Diagnostics\Extensions.cs (1)
92public static bool IsFeaturesAnalyzer(this AnalyzerReference reference)
Diagnostics\HostDiagnosticAnalyzers.cs (24)
19/// Key is <see cref="AnalyzerReference.Id"/>. 23private readonly ImmutableDictionary<object, AnalyzerReference> _hostAnalyzerReferencesMap; 34/// Key is <see cref="AnalyzerReference.Id"/>. 36/// Value is set of <see cref="DiagnosticAnalyzer"/> that belong to the <see cref="AnalyzerReference"/>. 55private readonly ConditionalWeakTable<IReadOnlyList<AnalyzerReference>, StrongBox<ImmutableDictionary<string, SkippedHostAnalyzersInfo>>> _skippedHostAnalyzers = new(); 57internal HostDiagnosticAnalyzers(IReadOnlyList<AnalyzerReference> hostAnalyzerReferences) 68/// List of host <see cref="AnalyzerReference"/>s 70public IReadOnlyList<AnalyzerReference> HostAnalyzerReferences { get; } 73/// Get <see cref="AnalyzerReference"/> identity and <see cref="DiagnosticAnalyzer"/>s map for given <paramref name="language"/> 94ImmutableDictionary<object, AnalyzerReference> map) 100if (!map.TryGetValue(id, out var reference) || reference == null) 121/// Create <see cref="AnalyzerReference"/> identity and <see cref="DiagnosticAnalyzer"/>s map for given <paramref name="project"/> that 133/// Create <see cref="AnalyzerReference"/> identity and <see cref="DiagnosticAnalyzer"/>s map for given <paramref name="project"/> that 139public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateProjectDiagnosticAnalyzersPerReference(IReadOnlyList<AnalyzerReference> projectAnalyzerReferences, string language) 156private ImmutableDictionary<object, AnalyzerReference> CreateProjectAnalyzerReferencesMap(IReadOnlyList<AnalyzerReference> projectAnalyzerReferences) 220IDictionary<object, AnalyzerReference> analyzerReferencesMap, string? language = null) 239static IEnumerable<KeyValuePair<object, AnalyzerReference>> Shuffle(IDictionary<object, AnalyzerReference> source) 248using var _ = ArrayBuilder<KeyValuePair<object, AnalyzerReference>>.GetInstance(source.Count, out var builder); 260private static ImmutableDictionary<object, AnalyzerReference> CreateAnalyzerReferencesMap(IEnumerable<AnalyzerReference> analyzerReferences) 262var builder = ImmutableDictionary.CreateBuilder<object, AnalyzerReference>(); 263foreach (var reference in analyzerReferences)
Diagnostics\SkippedHostAnalyzersInfo.cs (1)
49IReadOnlyList<AnalyzerReference> projectAnalyzerReferences,
Serialization\SerializationExtensions.cs (1)
28AnalyzerReference => WellKnownSynchronizationKind.AnalyzerReference,
Serialization\SerializerService.cs (2)
71return CreateChecksum((AnalyzerReference)value); 128SerializeAnalyzerReference((AnalyzerReference)value, writer);
Serialization\SerializerService_Asset.cs (2)
91private void SerializeAnalyzerReference(AnalyzerReference reference, ObjectWriter writer) 94private AnalyzerReference DeserializeAnalyzerReference(ObjectReader reader)
Serialization\SerializerService_Reference.cs (4)
54protected virtual Checksum CreateChecksum(AnalyzerReference reference) 116protected virtual void WriteAnalyzerReferenceTo(AnalyzerReference reference, ObjectWriter writer) 156protected virtual AnalyzerReference ReadAnalyzerReferenceFrom(ObjectReader reader) 485private static void WriteUnresolvedAnalyzerReferenceTo(AnalyzerReference reference, ObjectWriter writer)
Shared\Extensions\AnalyzerReferenceExtensions.cs (1)
11public static bool HasAnalyzersOrSourceGenerators(this AnalyzerReference analyzerFileReference, string language)
SourceGeneration\IRemoteSourceGenerationService.cs (2)
55/// Returns the identities for all source generators found in the <see cref="AnalyzerReference"/> with <see 62/// Returns whether or not the the <see cref="AnalyzerReference"/> with <see cref="AnalyzerFileReference.FullPath"/>
SourceGeneratorTelemetry\ISourceGeneratorTelemetryCollectorWorkspaceService.cs (1)
13void CollectRunResult(GeneratorDriverRunResult driverRunResult, GeneratorDriverTimingInfo driverTimingInfo, Func<ISourceGenerator, AnalyzerReference> getAnalyzerReference);
SourceGeneratorTelemetry\SourceGeneratorTelemetryCollectorWorkspaceService.cs (3)
21public GeneratorTelemetryKey(ISourceGenerator generator, AnalyzerReference analyzerReference) 45private GeneratorTelemetryKey GetTelemetryKey(ISourceGenerator generator, Func<ISourceGenerator, AnalyzerReference> getAnalyzerReference) 51Func<ISourceGenerator, AnalyzerReference> getAnalyzerReference)
Workspace\CommandLineProject.cs (1)
79var unresolvedAnalyzerReferences = boundAnalyzerReferences.FirstOrDefault(r => r is UnresolvedAnalyzerReference);
Workspace\IsolatedAnalyzerReferenceSet.cs (8)
23public static partial ValueTask<ImmutableArray<AnalyzerReference>> CreateIsolatedAnalyzerReferencesAsync( 25ImmutableArray<AnalyzerReference> references, 35public static partial ValueTask<ImmutableArray<AnalyzerReference>> CreateIsolatedAnalyzerReferencesAsync( 39Func<Task<ImmutableArray<AnalyzerReference>>> getReferencesAsync, 42private static ValueTask<ImmutableArray<AnalyzerReference>> DefaultCreateIsolatedAnalyzerReferencesAsync( 43ImmutableArray<AnalyzerReference> references) 48private static async ValueTask<ImmutableArray<AnalyzerReference>> DefaultCreateIsolatedAnalyzerReferencesAsync( 49Func<Task<ImmutableArray<AnalyzerReference>>> getReferencesAsync)
Workspace\IsolatedAnalyzerReferenceSet.Desktop.cs (4)
24public static partial ValueTask<ImmutableArray<AnalyzerReference>> CreateIsolatedAnalyzerReferencesAsync( 26ImmutableArray<AnalyzerReference> references, 33public static partial ValueTask<ImmutableArray<AnalyzerReference>> CreateIsolatedAnalyzerReferencesAsync( 37Func<Task<ImmutableArray<AnalyzerReference>>> getReferencesAsync,
Workspace\ISolutionAnalyzerSetterWorkspaceService.cs (2)
18void SetAnalyzerReferences(ImmutableArray<AnalyzerReference> references); 32public void SetAnalyzerReferences(ImmutableArray<AnalyzerReference> references)
Workspace\ProjectSystem\ProjectSystemProject.cs (4)
785foreach (var analyzerReference in project.AnalyzerReferences) 816ImmutableArray<AnalyzerReference>.CastUp(initialReferenceList.ToImmutableAndClear()), 1369IReadOnlyList<AnalyzerReference>? originalAnalyzerReferences = null; 1401foreach (var reference in originalAnalyzerReferences)
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
47public FileWatchedReferenceFactory<AnalyzerReference> FileWatchedAnalyzerReferenceFactory { get; }
Workspace\Solution\Project.cs (5)
145public IReadOnlyList<AnalyzerReference> AnalyzerReferences => State.AnalyzerReferences; 666public Project AddAnalyzerReference(AnalyzerReference analyzerReference) 673public Project AddAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences) 679public Project RemoveAnalyzerReference(AnalyzerReference analyzerReference) 686public Project WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferencs)
Workspace\Solution\ProjectChanges.cs (6)
72public IEnumerable<AnalyzerReference> GetAddedAnalyzerReferences() 74var oldAnalyzerReferences = new HashSet<AnalyzerReference>(OldProject.AnalyzerReferences); 75foreach (var analyzerReference in NewProject.AnalyzerReferences) 84public IEnumerable<AnalyzerReference> GetRemovedAnalyzerReferences() 86var newAnalyzerReferences = new HashSet<AnalyzerReference>(NewProject.AnalyzerReferences); 87foreach (var analyzerReference in OldProject.AnalyzerReferences)
Workspace\Solution\ProjectInfo.cs (7)
139public IReadOnlyList<AnalyzerReference> AnalyzerReferences { get; } 163IReadOnlyList<AnalyzerReference> analyzerReferences, 197IEnumerable<AnalyzerReference>? analyzerReferences, 225IEnumerable<AnalyzerReference>? analyzerReferences = null, 266IEnumerable<AnalyzerReference>? analyzerReferences = null, 291IReadOnlyList<AnalyzerReference>? analyzerReferences = null, 391public ProjectInfo WithAnalyzerReferences(IEnumerable<AnalyzerReference>? analyzerReferences)
Workspace\Solution\ProjectState.cs (2)
667public IReadOnlyList<AnalyzerReference> AnalyzerReferences => this.ProjectInfo.AnalyzerReferences; 849public ProjectState WithAnalyzerReferences(IReadOnlyList<AnalyzerReference> analyzerReferences)
Workspace\Solution\Solution.cs (13)
62IReadOnlyList<AnalyzerReference> analyzerReferences, 772public Solution AddAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) 787public Solution AddAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences) 798foreach (var analyzerReference in collection) 821public Solution RemoveAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) 832var builder = new FixedSizeArrayBuilder<AnalyzerReference>(oldProject.AnalyzerReferences.Count - 1); 850public Solution WithProjectAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences) 863public Solution AddAnalyzerReference(AnalyzerReference analyzerReference) 875public Solution AddAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences) 882foreach (var analyzerReference in collection) 899public Solution RemoveAnalyzerReference(AnalyzerReference analyzerReference) 915public Solution WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences) 1695public IReadOnlyList<AnalyzerReference> AnalyzerReferences => this.SolutionState.AnalyzerReferences;
Workspace\Solution\SolutionChanges.cs (6)
60public IEnumerable<AnalyzerReference> GetAddedAnalyzerReferences() 62var oldAnalyzerReferences = new HashSet<AnalyzerReference>(_oldSolution.AnalyzerReferences); 63foreach (var analyzerReference in _newSolution.AnalyzerReferences) 72public IEnumerable<AnalyzerReference> GetRemovedAnalyzerReferences() 74var newAnalyzerReferences = new HashSet<AnalyzerReference>(_newSolution.AnalyzerReferences); 75foreach (var analyzerReference in _oldSolution.AnalyzerReferences)
Workspace\Solution\SolutionCompilationState.cs (6)
716public SolutionCompilationState AddAnalyzerReferences(IReadOnlyCollection<AnalyzerReference> analyzerReferences) 724public SolutionCompilationState RemoveAnalyzerReference(AnalyzerReference analyzerReference) 732public SolutionCompilationState WithAnalyzerReferences(IReadOnlyList<AnalyzerReference> analyzerReferences) 742ProjectId projectId, IReadOnlyList<AnalyzerReference> analyzerReferences) 762var addedReferences = stateChange.NewProjectState.AnalyzerReferences.Except<AnalyzerReference>(stateChange.OldProjectState.AnalyzerReferences, ReferenceEqualityComparer.Instance).ToImmutableArray(); 763var removedReferences = stateChange.OldProjectState.AnalyzerReferences.Except<AnalyzerReference>(stateChange.NewProjectState.AnalyzerReferences, ReferenceEqualityComparer.Instance).ToImmutableArray();
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (2)
297var generatorAnalyzerReference = GetAnalyzerReference(this.ProjectState, generatorResult.Generator); 372AnalyzerReference analyzerReference,
Workspace\Solution\SolutionCompilationState_SourceGenerators.cs (4)
24using AnalyzerReferenceMap = ConditionalWeakTable<IReadOnlyList<AnalyzerReference>, AsyncLazy<bool>>; 30FrozenDictionary<ISourceGenerator, AnalyzerReference> SourceGeneratorToAnalyzerReference); 65private static AnalyzerReference GetAnalyzerReference(ProjectState projectState, ISourceGenerator sourceGenerator) 89using var _ = PooledDictionary<ISourceGenerator, AnalyzerReference>.GetInstance(out var generatorToAnalyzerReference);
Workspace\Solution\SolutionInfo.cs (4)
44public IReadOnlyList<AnalyzerReference> AnalyzerReferences { get; } 55IReadOnlyList<AnalyzerReference> analyzerReferences, 86IEnumerable<AnalyzerReference>? analyzerReferences = null) 97IEnumerable<AnalyzerReference>? analyzerReferences,
Workspace\Solution\SolutionState.cs (10)
43public IReadOnlyList<AnalyzerReference> AnalyzerReferences { get; } 70IReadOnlyList<AnalyzerReference> analyzerReferences, 98static Lazy<HostDiagnosticAnalyzers> CreateLazyHostDiagnosticAnalyzers(IReadOnlyList<AnalyzerReference> analyzerReferences) 107IReadOnlyList<AnalyzerReference> analyzerReferences, 170IReadOnlyList<AnalyzerReference>? analyzerReferences = null, 886public StateChange WithProjectAnalyzerReferences(ProjectId projectId, IReadOnlyList<AnalyzerReference> analyzerReferences) 1203public SolutionState AddAnalyzerReferences(IReadOnlyCollection<AnalyzerReference> analyzerReferences) 1215public SolutionState RemoveAnalyzerReference(AnalyzerReference analyzerReference) 1227public SolutionState WithAnalyzerReferences(IReadOnlyList<AnalyzerReference> analyzerReferences) 1366internal bool ContainsAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference)
Workspace\Solution\SourceGeneratedDocumentIdentity.cs (1)
35public static SourceGeneratedDocumentIdentity Generate(ProjectId projectId, string hintName, ISourceGenerator generator, string filePath, AnalyzerReference analyzerReference)
Workspace\Solution\SourceGeneratorIdentity.cs (2)
30public static SourceGeneratorIdentity Create(ISourceGenerator generator, AnalyzerReference analyzerReference) 40AnalyzerReference analyzerReference, string language)
Workspace\Workspace.cs (17)
127private Solution CreateSolution(SolutionInfo solutionInfo, SolutionOptionSet options, IReadOnlyList<AnalyzerReference> analyzerReferences, ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions) 930protected internal void OnAnalyzerReferenceAdded(ProjectId projectId, AnalyzerReference analyzerReference) 942protected internal void OnAnalyzerReferenceRemoved(ProjectId projectId, AnalyzerReference analyzerReference) 954internal void OnSolutionAnalyzerReferenceAdded(AnalyzerReference analyzerReference) 966internal void OnSolutionAnalyzerReferenceRemoved(AnalyzerReference analyzerReference) 1564foreach (var analyzerReference in solutionChanges.GetRemovedAnalyzerReferences()) 1569foreach (var analyzerReference in solutionChanges.GetAddedAnalyzerReferences()) 1867foreach (var analyzerReference in projectChanges.GetRemovedAnalyzerReferences()) 1873foreach (var analyzerReference in projectChanges.GetAddedAnalyzerReferences()) 2131protected virtual void ApplyAnalyzerReferenceAdded(ProjectId projectId, AnalyzerReference analyzerReference) 2142protected virtual void ApplyAnalyzerReferenceRemoved(ProjectId projectId, AnalyzerReference analyzerReference) 2153internal void ApplySolutionAnalyzerReferenceAdded(AnalyzerReference analyzerReference) 2164internal void ApplySolutionAnalyzerReferenceRemoved(AnalyzerReference analyzerReference) 2394protected void CheckProjectHasAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) 2405protected void CheckProjectDoesNotHaveAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) 2416internal static void CheckSolutionHasAnalyzerReference(Solution solution, AnalyzerReference analyzerReference) 2427internal static void CheckSolutionDoesNotHaveAnalyzerReference(Solution solution, AnalyzerReference analyzerReference)
Microsoft.CodeAnalysis.Workspaces.MSBuild (7)
MSBuild\MSBuildProjectLoader.Worker.AnalyzerReferencePathComparer.cs (4)
15private class AnalyzerReferencePathComparer : IEqualityComparer<AnalyzerReference?> 21public bool Equals(AnalyzerReference? x, AnalyzerReference? y) 24public int GetHashCode(AnalyzerReference? obj)
MSBuild\MSBuildProjectLoader.Worker.cs (1)
407private IEnumerable<AnalyzerReference> ResolveAnalyzerReferences(CommandLineArguments commandLineArgs)
MSBuild\MSBuildWorkspace.cs (2)
676protected override void ApplyAnalyzerReferenceAdded(ProjectId projectId, AnalyzerReference analyzerReference) 688protected override void ApplyAnalyzerReferenceRemoved(ProjectId projectId, AnalyzerReference analyzerReference)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (19)
Remote\TestSerializerService.cs (3)
65protected override Checksum CreateChecksum(AnalyzerReference reference) 84protected override void WriteAnalyzerReferenceTo(AnalyzerReference reference, ObjectWriter writer) 99protected override AnalyzerReference ReadAnalyzerReferenceFrom(ObjectReader reader)
TestGeneratorReference.cs (1)
13/// A simple deriviation of <see cref="AnalyzerReference"/> that returns the source generator
Workspaces\TestHostProject.cs (3)
50IEnumerable<AnalyzerReference> analyzerReferences = null, 70IList<AnalyzerReference> analyzerReferences = null, 100IEnumerable<AnalyzerReference> analyzerReferences = null,
Workspaces\TestHostProject`1.cs (6)
26private readonly IEnumerable<AnalyzerReference> _analyzerReferences; 45public IEnumerable<AnalyzerReference> AnalyzerReferences 102IList<AnalyzerReference> analyzerReferences = null, 112_analyzerReferences = analyzerReferences ?? SpecializedCollections.EmptyEnumerable<AnalyzerReference>(); 135IEnumerable<AnalyzerReference> analyzerReferences = null, 153_analyzerReferences = analyzerReferences ?? SpecializedCollections.EmptyEnumerable<AnalyzerReference>();
Workspaces\TestWorkspace.cs (1)
74IList<AnalyzerReference>? analyzerReferences = null,
Workspaces\TestWorkspace_XmlConsumption.cs (2)
823private static IList<AnalyzerReference> CreateAnalyzerList(XElement projectElement) 825var analyzers = new List<AnalyzerReference>();
Workspaces\TestWorkspace`1.cs (3)
214IList<AnalyzerReference>? analyzerReferences = null, 291public new void OnAnalyzerReferenceAdded(ProjectId projectId, AnalyzerReference analyzerReference) 804foreach (var analyzer in this.CurrentSolution.AnalyzerReferences)
Microsoft.CodeAnalysis.Workspaces.UnitTests (21)
CommandLineProject\CommandLineProjectTests.cs (2)
153var analyzerRef = info.AnalyzerReferences.Single(); 167var analyzerRef = info.AnalyzerReferences.Single();
SolutionTests\ProjectInfoTests.cs (5)
154Assert.Same(analyzerReference, ((ImmutableArray<AnalyzerReference>)info1.AnalyzerReferences).Single()); 157Assert.True(((ImmutableArray<AnalyzerReference>)info2.AnalyzerReferences).IsEmpty); 160Assert.True(((ImmutableArray<AnalyzerReference>)info3.AnalyzerReferences).IsEmpty); 163Assert.True(((ImmutableArray<AnalyzerReference>)info4.AnalyzerReferences).IsEmpty); 203SolutionTestHelpers.TestListProperty(instance, (old, value) => old.WithAnalyzerReferences(value), opt => opt.AnalyzerReferences, (AnalyzerReference)new TestAnalyzerReference(), allowDuplicates: false);
SolutionTests\SolutionTests.cs (11)
2147var analyzerRef = (AnalyzerReference)new TestAnalyzerReference(); 2166var solution2 = solution.AddAnalyzerReferences(projectId, EmptyEnumerable<AnalyzerReference>()); 2173AssertEx.Equal((AnalyzerReference[])[analyzerRef1, analyzerRef2], solution3.GetProject(projectId)!.AnalyzerReferences); 2199AssertEx.Equal((AnalyzerReference[])[analyzerRef2], solution2.GetProject(projectId)!.AnalyzerReferences); 2219var analyzerRef = (AnalyzerReference)new TestAnalyzerReference(); 2234var solution2 = solution.AddAnalyzerReferences(EmptyEnumerable<AnalyzerReference>()); 2241AssertEx.Equal((AnalyzerReference[])[analyzerRef1, analyzerRef2], solution3.AnalyzerReferences); 2265AssertEx.Equal((AnalyzerReference[])[analyzerRef2], solution2.AnalyzerReferences); 3000var addedAnalyzerReference = changes.GetAddedAnalyzerReferences().Single();
SolutionTests\SolutionWithSourceGeneratorTests.cs (3)
106private class TestGeneratorReferenceWithFilePathEquality : TestGeneratorReference, IEquatable<AnalyzerReference> 113public override bool Equals(object? obj) => Equals(obj as AnalyzerReference); 117public bool Equals(AnalyzerReference? other)
Microsoft.VisualStudio.LanguageServices (7)
Diagnostics\VisualStudioDiagnosticAnalyzerProvider.WorkspaceEventListener.cs (1)
61setter.SetAnalyzerReferences(references.SelectAsArray(referenceAndId => (AnalyzerReference)referenceAndId.reference));
Preview\ReferenceChange.AnalyzerReferenceChange.cs (2)
16private readonly AnalyzerReference _reference; 18public AnalyzerReferenceChange(AnalyzerReference reference, ProjectId projectId, string projectName, bool isAdded, PreviewEngine engine)
ProjectSystem\VisualStudioWorkspaceImpl.cs (3)
479private static string? GetAnalyzerPath(AnalyzerReference analyzerReference) 517protected override void ApplyAnalyzerReferenceAdded(ProjectId projectId, AnalyzerReference analyzerReference) 539protected override void ApplyAnalyzerReferenceRemoved(ProjectId projectId, AnalyzerReference analyzerReference)
ProjectSystem\VisualStudioWorkspaceImpl.SolutionAnalyzerSetterService.cs (1)
28public void SetAnalyzerReferences(ImmutableArray<AnalyzerReference> references)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
ProjectSystemShim\CPS\CSharpReferencesTests.cs (1)
140.AnalyzerReferences.Cast<AnalyzerReference>()
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Diagnostics\VisualStudioDiagnosticAnalyzerProviderTests.vb (1)
55Dim hostAnalyzers = New HostDiagnosticAnalyzers(ImmutableArray.Create(Of AnalyzerReference)(New AnalyzerFileReference(analyzerFile.Path, analyzerLoader)))
Roslyn.VisualStudio.Next.UnitTests (1)
Remote\SerializationValidator.cs (1)
167await VerifyAssetSerializationAsync<AnalyzerReference>(