Support for getting severity from single diagnostic

This commit is contained in:
Deukhoofd 2019-09-07 12:16:53 +02:00
parent d36d091d28
commit d13eb7d2d5
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 20 additions and 1 deletions

View File

@ -8,7 +8,7 @@ namespace PorygonSharp.DiagnosticHandling
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct InternalRepresentation public struct InternalRepresentation
{ {
private readonly int _severity; private readonly DiagnosticSeverity _severity;
private readonly DiagnosticCode _code; private readonly DiagnosticCode _code;
private readonly uint _start; private readonly uint _start;
private readonly uint _length; private readonly uint _length;
@ -17,6 +17,11 @@ namespace PorygonSharp.DiagnosticHandling
{ {
return _code; return _code;
} }
public DiagnosticSeverity GetSeverity()
{
return _severity;
}
} }
private InternalRepresentation _internalRepresentation; private InternalRepresentation _internalRepresentation;
@ -51,5 +56,10 @@ namespace PorygonSharp.DiagnosticHandling
{ {
return Internal.GetCode(); return Internal.GetCode();
} }
public DiagnosticSeverity GetSeverity()
{
return Internal.GetSeverity();
}
} }
} }

View File

@ -0,0 +1,9 @@
namespace PorygonSharp.DiagnosticHandling
{
public enum DiagnosticSeverity
{
Info,
Warning,
Error
}
}