78 references to DiagnosticData
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
Diagnostics\AnalyzerLoadFailureTests.cs (1)
34var diagnostic = DocumentAnalysisExecutor.CreateAnalyzerLoadFailureDiagnostic(eventArgs, "Analyzer.dll", null, languageName);
Diagnostics\DiagnosticDataTests.cs (3)
163var roundTripDiagnosticData = DiagnosticData.Create(diagnostic, document); 209var roundTripDiagnosticData = DiagnosticData.Create(diagnostic, document); 265var roundTripDiagnosticData = DiagnosticData.Create(diagnostic, firstDocument);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
InlineDiagnostics\AbstractDiagnosticsTaggerProvider.cs (1)
69/// In most cases, this is the <see cref="DiagnosticData.DataLocation"/> but overrides can change it (e.g. unnecessary classifications).
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Extensions\ProtocolConversions.Diagnostics.cs (1)
21/// Converts from <see cref="DiagnosticData"/> to <see cref="LSP.Diagnostic"/>
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (1)
194var diag = fix.GetPrimaryDiagnosticData();
Microsoft.CodeAnalysis.Workspaces (70)
CodeFixes\CodeFix.cs (4)
58internal DiagnosticData GetPrimaryDiagnosticData() 67return DiagnosticData.Create(diagnostic, document); 75return DiagnosticData.Create(diagnostic, document); 79return DiagnosticData.Create(Project.Solution, diagnostic, Project);
Diagnostics\DiagnosticAnalysisResult.cs (33)
36private readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? _syntaxLocals; 41private readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? _semanticLocals; 46private readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? _nonLocals; 51private readonly ImmutableArray<DiagnosticData> _others; 70ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> syntaxLocals, 71ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> semanticLocals, 72ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> nonLocals, 73ImmutableArray<DiagnosticData> others, 101syntaxLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 102semanticLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 103nonLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 118public static DiagnosticAnalysisResult CreateFromBuild(Project project, ImmutableArray<DiagnosticData> diagnostics, IEnumerable<DocumentId> initialDocuments) 127var diagnosticsWithDocumentId = PooledDictionary<DocumentId, ArrayBuilder<DiagnosticData>>.GetInstance(); 128var diagnosticsWithoutDocumentId = ArrayBuilder<DiagnosticData>.GetInstance(); 130foreach (var data in diagnostics) 148syntaxLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 150nonLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 160ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> syntaxLocalMap, 161ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> semanticLocalMap, 162ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> nonLocalMap, 163ImmutableArray<DiagnosticData> others, 202private ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? GetMap(AnalysisKind kind) 211public ImmutableArray<DiagnosticData> GetAllDiagnostics() 224using var _ = ArrayBuilder<DiagnosticData>.GetInstance(out var builder); 235foreach (var data in _others) 241public ImmutableArray<DiagnosticData> GetDocumentDiagnostics(DocumentId documentId, AnalysisKind kind) 260public ImmutableArray<DiagnosticData> GetOtherDiagnostics() 285semanticLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 286nonLocals: ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty, 293ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? syntaxLocals, 294ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? semanticLocals, 295ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>? nonLocals) 324private static void VerifyDocumentMap(Project project, ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> map)
Diagnostics\DiagnosticAnalysisResultBuilder.cs (23)
26private Dictionary<DocumentId, List<DiagnosticData>>? _lazySyntaxLocals = null; 27private Dictionary<DocumentId, List<DiagnosticData>>? _lazySemanticLocals = null; 28private Dictionary<DocumentId, List<DiagnosticData>>? _lazyNonLocals = null; 30private List<DiagnosticData>? _lazyOthers = null; 33public readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> SyntaxLocals => Convert(_lazySyntaxLocals); 34public readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> SemanticLocals => Convert(_lazySemanticLocals); 35public readonly ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> NonLocals => Convert(_lazyNonLocals); 36public readonly ImmutableArray<DiagnosticData> Others => _lazyOthers == null ? [] : [.. _lazyOthers]; 52ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, DocumentId documentId, IEnumerable<Diagnostic> diagnostics) 75AddOtherDiagnostic(DiagnosticData.Create(Project.Solution, diagnostic, Project)); 82AddOtherDiagnostic(DiagnosticData.Create(Project.Solution, diagnostic, Project)); 97private void AddDocumentDiagnostic(ref Dictionary<DocumentId, List<DiagnosticData>>? map, TextDocument? document, Diagnostic diagnostic) 105map.GetOrAdd(document.Id, _ => []).Add(DiagnosticData.Create(diagnostic, document)); 111private void AddOtherDiagnostic(DiagnosticData data) 128Dictionary<DocumentId, List<DiagnosticData>>? dummy = null; 136ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, SyntaxTree? tree, Diagnostic diagnostic) 149AddOtherDiagnostic(DiagnosticData.Create(Project.Solution, diagnostic, Project)); 155AddOtherDiagnostic(DiagnosticData.Create(Project.Solution, diagnostic, Project)); 173AddOtherDiagnostic(DiagnosticData.Create(Project.Solution, diagnostic, Project)); 189ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, SyntaxTree? tree, IEnumerable<Diagnostic> diagnostics) 195private static ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>> Convert(Dictionary<DocumentId, List<DiagnosticData>>? map) 198? ImmutableDictionary<DocumentId, ImmutableArray<DiagnosticData>>.Empty
Diagnostics\DiagnosticData.cs (8)
37bool isSuppressed = false) : IEquatable<DiagnosticData?> 99public DiagnosticData WithLocations(DiagnosticDataLocation location, ImmutableArray<DiagnosticDataLocation> additionalLocations) 107=> obj is DiagnosticData data && Equals(data); 109public bool Equals(DiagnosticData? other) 189public static DiagnosticData Create(Solution solution, Diagnostic diagnostic, Project? project) 194public static DiagnosticData Create(Diagnostic diagnostic, TextDocument document) 220private static DiagnosticData Create( 282public static bool TryCreate(DiagnosticDescriptor descriptor, string[] messageArguments, Project project, [NotNullWhen(true)] out DiagnosticData? diagnosticData)
Diagnostics\Extensions.cs (2)
24public static async Task<ImmutableArray<Diagnostic>> ToDiagnosticsAsync(this IEnumerable<DiagnosticData> diagnostics, Project project, CancellationToken cancellationToken) 27foreach (var diagnostic in diagnostics)
Microsoft.VisualStudio.LanguageServices (1)
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (1)
186/// Gets <see cref="DiagnosticData"/> objects for selected error list entries.