public WarningInfo(WarningID id, WarningLevel level, string name, string description) { ID = id; Level = level; Name = name; Description = description; }
// use the per-warning factory methods instead private Warning(int line, WarningID number, string message) { this.Line = line; this.Number = number; this.Message = message; this.Info = WarningTypes[number]; }
private void ReportWarning(WarningID id, WarningLocation location, string value, string message) => SourceFile.ParsingResult.ParserWarnings.Add( new Warning( id, location, value, message, ParserIdentifier));
internal ValidationReport AddWarning(WarningID id, WarningLocation location, string value, string messageFormat, params string[] messageArgs) { AddWarning( new Warning( id, location, value, string.Format(messageFormat, messageArgs), nameof(ValidationContext))); return(this); }
public void WarningID_Equals() { var warningIdOne = new WarningID(-9001, "Foo"); var warningIdTwo = new WarningID(-9001, "Bar"); Assert.NotSame(warningIdOne, warningIdTwo); Assert.Equal(warningIdOne, warningIdTwo); warningIdOne = WarningIDs.EmptyCodeBlock; warningIdTwo = new WarningID(warningIdOne.ID, string.Empty); Assert.NotSame(warningIdOne, warningIdTwo); Assert.Equal(warningIdOne, warningIdTwo); }
public RollingContextTest Assert(WarningID id, int start, int end, string value, string fileName = DefaultFileName) => Assert((fileName, id, start, end, value));
/// <summary> /// Report a warning that applies to the entire reference /// </summary> internal void ReportWarning(WarningID id, string messageFormat, params string[] messageArgs) => Context.ReportWarning(id, Reference, messageFormat, messageArgs);
/// <summary> /// Report a warning about a specific span of source /// </summary> public void ReportWarning(WarningID id, SourceSpan span, string value, string messageFormat, params string[] messageArgs) => ReportWarning(id, new WarningLocation(SourceFile, span), value, string.Format(messageFormat, messageArgs));
/// <summary> /// Report a warning about a specific span of source /// </summary> public void ReportWarning(WarningID id, int start, int end, string value, string messageFormat, params string[] messageArgs) => ReportWarning(id, new SourceSpan(start, end), value, messageFormat, messageArgs);
/// <summary> /// Report a warning that applies to the entire reference /// </summary> internal void ReportWarning(WarningID id, Reference reference, string messageFormat, params string[] messageArgs) => ReportWarning(id, new WarningLocation(SourceFile, reference), reference.RawReference, string.Format(messageFormat, messageArgs));
/// <summary> /// Report a warning that applies to the entire parsed object /// </summary> public void ReportWarning(WarningID id, string value, string messageFormat, params string[] messageArgs) => ReportWarning(id, Object.Span, value, messageFormat, messageArgs);