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