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