public void WarningLocation_Differs_FileName() { var warningLocationOne = new WarningLocation("Foo", "Foo", new SourceSpan(1, 2)); var warningLocationTwo = new WarningLocation("Bar", "Bar", new SourceSpan(1, 2)); Assert.NotEqual(warningLocationOne, warningLocationTwo); }
public void WarningLocation_Equals() { var warningLocationOne = new WarningLocation("Foo", "Foo", new SourceSpan(1, 2)); var warningLocationTwo = new WarningLocation("Foo", "Foo", new SourceSpan(1, 2)); Assert.NotSame(warningLocationOne, warningLocationTwo); Assert.Equal(warningLocationOne, warningLocationTwo); }
public void Execute() { string fileLocation = FileStorage.CreateFile(); WarningLocation warningLocation = _warningsController.GetSelectedWarning(); File.WriteAllText($"{fileLocation}Warnings.json", JsonConvert.SerializeObject(warningLocation.GetWarnings())); }
private void ReportWarning(WarningID id, WarningLocation location, string value, string message) => SourceFile.ParsingResult.ParserWarnings.Add( new Warning( id, location, value, message, ParserIdentifier));
public static CssErrorFlags ToCssErrorFlags(this WarningLocation location) { switch (location) { case WarningLocation.Warnings: return(CssErrorFlags.UnderlinePurple | CssErrorFlags.TaskListWarning); default: return(CssErrorFlags.UnderlinePurple | CssErrorFlags.TaskListMessage); } }
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); }
private static Range ToRange(WarningLocation location) { if (!location.RefersToEntireFile) { return(new Range( new Position(location.StartLine, location.StartLineColumn), new Position(location.EndLine, location.EndLineColumn))); } else { return(new Range(new Position(0, 0), new Position(0, 0))); } }