mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
24 lines
745 B
C#
24 lines
745 B
C#
using System.IO;
|
|
|
|
namespace Semmle.Extraction.CSharp.Entities
|
|
{
|
|
internal class Diagnostic : FreshEntity
|
|
{
|
|
public override TrapStackBehaviour TrapStackBehaviour => TrapStackBehaviour.NoLabel;
|
|
|
|
private readonly Microsoft.CodeAnalysis.Diagnostic diagnostic;
|
|
|
|
public Diagnostic(Context cx, Microsoft.CodeAnalysis.Diagnostic diag) : base(cx)
|
|
{
|
|
diagnostic = diag;
|
|
TryPopulate();
|
|
}
|
|
|
|
protected override void Populate(TextWriter trapFile)
|
|
{
|
|
trapFile.diagnostics(this, (int)diagnostic.Severity, diagnostic.Id, diagnostic.Descriptor.Title.ToString(),
|
|
diagnostic.GetMessage(), Context.CreateLocation(diagnostic.Location));
|
|
}
|
|
}
|
|
}
|