1 type derived from DiagnosticInfo
Microsoft.CodeAnalysis (1)
Diagnostic\CustomObsoleteDiagnosticInfo.cs (1)
10
internal sealed class CustomObsoleteDiagnosticInfo :
DiagnosticInfo
16 instantiations of DiagnosticInfo
Microsoft.CodeAnalysis (16)
CommandLine\CommandLineArguments.cs (7)
445
diagnosticsOpt.Add(new
DiagnosticInfo
(messageProviderOpt, messageProviderOpt.ERR_MetadataFileNotFound, cmdReference.Reference));
491
diagnostic = new
DiagnosticInfo
(messageProvider, messageProvider.WRN_UnableToLoadAnalyzer, analyzerReference.FullPath, e.Message);
494
diagnostic = new
DiagnosticInfo
(messageProvider, messageProvider.WRN_AnalyzerCannotBeCreated, e.TypeName ?? "", analyzerReference.FullPath, e.Message);
497
diagnostic = new
DiagnosticInfo
(messageProvider, messageProvider.WRN_NoAnalyzerInAssembly, analyzerReference.FullPath);
500
diagnostic = new
DiagnosticInfo
(messageProvider, messageProvider.WRN_AnalyzerReferencesFramework, analyzerReference.FullPath, e.TypeName!);
503
diagnostic = new
DiagnosticInfo
(messageProvider, messageProvider.WRN_AnalyzerReferencesNewerCompiler, analyzerReference.FullPath, e.ReferencedCompilerVersion!.ToString(), typeof(AnalyzerFileReference).Assembly.GetName().Version!.ToString());
542
diagnostics.Add(new
DiagnosticInfo
(messageProvider, messageProvider.ERR_MetadataFileNotFound, reference.FilePath));
CommandLine\CommonCompiler.CompilerEmitStreamProvider.cs (1)
44
var diagnosticInfo = new
DiagnosticInfo
(messageProvider, messageProvider.ERR_OutputWriteFailed, _filePath, e.Message);
CommandLine\CommonCompiler.cs (5)
511
diagnosticInfo = new
DiagnosticInfo
(messageProvider, messageProvider.ERR_FileNotFound, filePath);
515
diagnosticInfo = new
DiagnosticInfo
(messageProvider, messageProvider.ERR_BinaryFile, filePath);
519
diagnosticInfo = new
DiagnosticInfo
(messageProvider, messageProvider.ERR_NoSourceFile, filePath, e.Message);
789
var diag = new
DiagnosticInfo
(MessageProvider, errorCode);
1648
errors = diagnostics.ToReadOnlyAndFree().SelectAsArray(diag => new
DiagnosticInfo
(messageProvider, diag.IsWarningAsError, diag.Code, (object[])diag.Arguments));
Diagnostic\Diagnostic.cs (2)
282
return Create(new
DiagnosticInfo
(messageProvider, errorCode));
287
return Create(new
DiagnosticInfo
(messageProvider, errorCode, arguments));
Diagnostic\DiagnosticInfo.cs (1)
179
return new
DiagnosticInfo
(this, severity);
121 references to DiagnosticInfo
Microsoft.CodeAnalysis (106)
AdditionalTextFile.cs (4)
21
private IList<
DiagnosticInfo
> _diagnostics;
32
_diagnostics = SpecializedCollections.EmptyList<
DiagnosticInfo
>();
38
var diagnostics = new List<
DiagnosticInfo
>();
59
internal IList<
DiagnosticInfo
> Diagnostics => _diagnostics;
Binding\BindingDiagnosticBag.cs (5)
231
foreach (
var
diagnosticInfo in useSiteInfo.Diagnostics)
247
foreach (
var
info in useSiteInfo.Diagnostics)
271
protected abstract bool ReportUseSiteDiagnostic(
DiagnosticInfo
diagnosticInfo, DiagnosticBag diagnosticBag, Location location);
293
internal bool ReportUseSiteDiagnostic(
DiagnosticInfo
? info, Location location)
296
internal bool ReportUseSiteDiagnostic<TData>(
DiagnosticInfo
? info, Func<TData, Location> getLocation, TData data)
Binding\UseSiteInfo.cs (30)
23
public readonly
DiagnosticInfo
? DiagnosticInfo;
48
public UseSiteInfo(
DiagnosticInfo
? diagnosticInfo) :
53
public UseSiteInfo(
DiagnosticInfo
? diagnosticInfo, TAssemblySymbol? primaryDependency) :
58
public UseSiteInfo(
DiagnosticInfo
? diagnosticInfo, TAssemblySymbol? primaryDependency, ImmutableHashSet<TAssemblySymbol>? secondaryDependencies)
71
public UseSiteInfo<TAssemblySymbol> AdjustDiagnosticInfo(
DiagnosticInfo
? diagnosticInfo)
110
private HashSet<
DiagnosticInfo
>? _diagnostics;
197
public IReadOnlyCollection<
DiagnosticInfo
>? Diagnostics
260
public void AddDiagnostics(ICollection<
DiagnosticInfo
>? diagnostics)
269
_diagnostics ??= new HashSet<
DiagnosticInfo
>();
271
foreach (
var
diagnosticInfo in diagnostics)
278
private void AccumulateDiagnosticInfoAndRecordPresenceOfAnError(
DiagnosticInfo
diagnosticInfo)
288
public void AddDiagnostics(IReadOnlyCollection<
DiagnosticInfo
>? diagnostics)
297
_diagnostics ??= new HashSet<
DiagnosticInfo
>();
299
foreach (
var
diagnosticInfo in diagnostics)
306
public void AddDiagnostics(ImmutableArray<
DiagnosticInfo
> diagnostics)
315
_diagnostics ??= new HashSet<
DiagnosticInfo
>();
317
foreach (
var
diagnosticInfo in diagnostics)
324
public void AddDiagnosticInfo(
DiagnosticInfo
diagnosticInfo)
331
_diagnostics ??= new HashSet<
DiagnosticInfo
>();
455
/// - a <see cref="
DiagnosticInfo
"/>, or
457
/// - a <see cref="Boxed"/> tuple of a <see cref="
DiagnosticInfo
"/> and a <see cref="ImmutableHashSet{TAssemblySymbol}"/>.
472
public void Initialize(
DiagnosticInfo
? diagnosticInfo)
498
Expand(_info, out
var
diagnosticInfo, out var dependencies);
508
private void Initialize(
DiagnosticInfo
? diagnosticInfo, ImmutableHashSet<TAssemblySymbol> dependencies)
513
private static object? Compact(
DiagnosticInfo
? diagnosticInfo, ImmutableHashSet<TAssemblySymbol> dependencies)
557
Expand(info, out
var
diagnosticInfo, out var dependencies);
561
private static void Expand(object? info, out
DiagnosticInfo
? diagnosticInfo, out ImmutableHashSet<TAssemblySymbol>? dependencies)
570
case
DiagnosticInfo
d:
593
public readonly
DiagnosticInfo
DiagnosticInfo;
601
public Boxed(
DiagnosticInfo
diagnosticInfo, ImmutableHashSet<TAssemblySymbol> dependencies)
CommandLine\CommandLineArguments.cs (5)
390
internal IEnumerable<MetadataReference> ResolveMetadataReferences(MetadataReferenceResolver metadataResolver, List<
DiagnosticInfo
>? diagnosticsOpt, CommonMessageProvider? messageProviderOpt)
400
internal virtual bool ResolveMetadataReferences(MetadataReferenceResolver metadataResolver, List<
DiagnosticInfo
>? diagnosticsOpt, CommonMessageProvider? messageProviderOpt, List<MetadataReference> resolved)
425
internal static ImmutableArray<PortableExecutableReference> ResolveMetadataReference(CommandLineReference cmdReference, MetadataReferenceResolver metadataResolver, List<
DiagnosticInfo
>? diagnosticsOpt, CommonMessageProvider? messageProviderOpt)
472
List<
DiagnosticInfo
> diagnostics,
487
DiagnosticInfo
? diagnostic;
CommandLine\CommonCompiler.CompilerEmitStreamProvider.cs (1)
44
var
diagnosticInfo = new DiagnosticInfo(messageProvider, messageProvider.ERR_OutputWriteFailed, _filePath, e.Message);
CommandLine\CommonCompiler.cs (11)
118
List<
DiagnosticInfo
> diagnostics,
228
List<
DiagnosticInfo
> diagnostics,
256
internal SourceText? TryReadFileContent(CommandLineSourceFile file, IList<
DiagnosticInfo
> diagnostics)
268
internal SourceText? TryReadFileContent(CommandLineSourceFile file, IList<
DiagnosticInfo
> diagnostics, out string? normalizedFilePath)
505
internal static
DiagnosticInfo
ToFileReadDiagnostics(CommonMessageProvider messageProvider, Exception e, string filePath)
507
DiagnosticInfo
diagnosticInfo;
601
internal bool ReportDiagnostics(IEnumerable<
DiagnosticInfo
> diagnostics, TextWriter consoleOutput, ErrorLogger? errorLoggerOpt, Compilation? compilation)
789
var
diag = new DiagnosticInfo(MessageProvider, errorCode);
945
var diagnosticInfos = new List<
DiagnosticInfo
>();
1598
protected virtual ImmutableArray<AdditionalTextFile> ResolveAdditionalFilesFromArguments(List<
DiagnosticInfo
> diagnostics, CommonMessageProvider messageProvider, TouchedFileLogger? touchedFilesLogger)
1644
out IEnumerable<
DiagnosticInfo
> errors)
Diagnostic\CommonMessageProvider.cs (7)
88
public abstract Diagnostic CreateDiagnostic(
DiagnosticInfo
info);
124
/// A new <see cref="
DiagnosticInfo
"/> with new effective severity based on the options or null if the
127
public abstract ReportDiagnostic GetDiagnosticReport(
DiagnosticInfo
diagnosticInfo, CompilationOptions options);
130
/// Filter a <see cref="
DiagnosticInfo
"/> based on the compilation options so that /nowarn and /warnaserror etc. take effect.options
132
/// <returns>A <see cref="
DiagnosticInfo
"/> with effective severity based on option or null if suppressed.</returns>
133
public
DiagnosticInfo
? FilterDiagnosticInfo(
DiagnosticInfo
diagnosticInfo, CompilationOptions options)
Diagnostic\CustomObsoleteDiagnosticInfo.cs (1)
54
protected override
DiagnosticInfo
GetInstanceWithSeverityCore(DiagnosticSeverity severity)
Diagnostic\Diagnostic.cs (1)
290
internal static Diagnostic Create(
DiagnosticInfo
info)
Diagnostic\DiagnosticInfo.cs (9)
58
protected DiagnosticInfo(
DiagnosticInfo
original, DiagnosticSeverity overriddenSeverity)
163
internal
DiagnosticInfo
GetInstanceWithSeverity(DiagnosticSeverity severity)
167
var
result = GetInstanceWithSeverityCore(severity);
177
protected virtual
DiagnosticInfo
GetInstanceWithSeverityCore(DiagnosticSeverity severity)
335
var
embedded = _arguments[i] as
DiagnosticInfo
;
408
DiagnosticInfo
? other = obj as
DiagnosticInfo
;
454
internal virtual
DiagnosticInfo
GetResolvedInfo()
Diagnostic\DiagnosticWithInfo.cs (4)
20
private readonly
DiagnosticInfo
_info;
24
internal DiagnosticWithInfo(
DiagnosticInfo
info, Location location, bool isSuppressed = false)
112
public
DiagnosticInfo
Info
141
internal
DiagnosticInfo
LazyInfo
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.cs (1)
32
builder.Add(
DiagnosticInfo
.GetDescriptor(errorCode, messageProvider));
Syntax\GreenNode.cs (13)
42
private static readonly ConditionalWeakTable<GreenNode,
DiagnosticInfo
[]> s_diagnosticsTable =
43
new ConditionalWeakTable<GreenNode,
DiagnosticInfo
[]>();
48
private static readonly
DiagnosticInfo
[] s_noDiagnostics = Array.Empty<
DiagnosticInfo
>();
63
protected GreenNode(ushort kind,
DiagnosticInfo
[]? diagnostics, int fullWidth)
74
protected GreenNode(ushort kind,
DiagnosticInfo
[]? diagnostics)
84
protected GreenNode(ushort kind,
DiagnosticInfo
[]? diagnostics, SyntaxAnnotation[]? annotations) :
99
protected GreenNode(ushort kind,
DiagnosticInfo
[]? diagnostics, SyntaxAnnotation[]? annotations, int fullWidth) :
591
internal
DiagnosticInfo
[] GetDiagnostics()
595
DiagnosticInfo
[]? diags;
605
internal abstract GreenNode SetDiagnostics(
DiagnosticInfo
[]? diagnostics);
1037
internal GreenNode AddError(
DiagnosticInfo
err)
1039
DiagnosticInfo
[] errorInfos;
Syntax\GreenNodeExtensions.cs (1)
110
public static TNode WithDiagnosticsGreen<TNode>(this TNode node,
DiagnosticInfo
[]? diagnostics) where TNode : GreenNode
Syntax\InternalSyntax\SyntaxDiagnosticInfoList.cs (2)
25
internal bool Any(Func<
DiagnosticInfo
, bool> predicate)
56
public
DiagnosticInfo
Current { get; private set; }
Syntax\InternalSyntax\SyntaxList.cs (1)
17
internal SyntaxList(
DiagnosticInfo
[]? diagnostics, SyntaxAnnotation[]? annotations)
Syntax\InternalSyntax\SyntaxList.WithLotsOfChildren.cs (2)
22
internal WithLotsOfChildren(
DiagnosticInfo
[]? diagnostics, SyntaxAnnotation[]? annotations, ArrayElement<GreenNode>[] children, int[] childOffsets)
61
internal override GreenNode SetDiagnostics(
DiagnosticInfo
[]? errors)
Syntax\InternalSyntax\SyntaxList.WithManyChildren.cs (3)
22
internal WithManyChildrenBase(
DiagnosticInfo
[]? diagnostics, SyntaxAnnotation[]? annotations, ArrayElement<GreenNode>[] children)
100
internal WithManyChildren(
DiagnosticInfo
[]? diagnostics, SyntaxAnnotation[]? annotations, ArrayElement<GreenNode>[] children)
105
internal override GreenNode SetDiagnostics(
DiagnosticInfo
[]? errors)
Syntax\InternalSyntax\SyntaxList.WithThreeChildren.cs (2)
28
internal WithThreeChildren(
DiagnosticInfo
[]? diagnostics, SyntaxAnnotation[]? annotations, GreenNode child0, GreenNode child1, GreenNode child2)
67
internal override GreenNode SetDiagnostics(
DiagnosticInfo
[]? errors)
Syntax\InternalSyntax\SyntaxList.WithTwoChildren.cs (2)
25
internal WithTwoChildren(
DiagnosticInfo
[]? diagnostics, SyntaxAnnotation[]? annotations, GreenNode child0, GreenNode child1)
59
internal override GreenNode SetDiagnostics(
DiagnosticInfo
[]? errors)
Syntax\SyntaxToken.cs (1)
23
private static readonly Func<
DiagnosticInfo
, Diagnostic> s_createDiagnosticWithoutLocation = Diagnostic.Create;
Microsoft.CodeAnalysis.CSharp (5)
Emitter\Model\PEModuleBuilder.cs (2)
1098
var
diagnosticInfo = declaredBase.GetUseSiteInfo().DiagnosticInfo;
1964
var
info = typeSymbol.GetUseSiteInfo().DiagnosticInfo;
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1433
var
diagnosticInfo = result.DiagnosticInfo;
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
813
var
useSiteDiagnostic = type.GetUseSiteInfo().DiagnosticInfo;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (1)
250
var
diagnosticInfo = useSiteInfo.DiagnosticInfo;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (9)
Symbols\ErrorTypeSymbolTests.cs (1)
117
var
info = error.ErrorInfo;
Symbols\Source\BaseClassTests.cs (8)
82
var
er = x_base_base.ErrorInfo;
109
var
er = x_base.ErrorInfo;
138
var
er = x_base.ErrorInfo;
998
var
er = x_base_base.ErrorInfo;
1043
var
er = errorBase.ErrorInfo;
1104
var
er = errorBase.ErrorInfo;
1139
var
er = errorBase.ErrorInfo;
1196
var
er = errorBase.ErrorInfo;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Diagnostics\DiagnosticTest.cs (1)
126
var
other = diagnostic.GetInstanceWithSeverity(DiagnosticSeverity.Info);