/// <summary> /// Determines whether the errors are equal. /// </summary> /// <param name="item">The item.</param> /// <param name="error">The error.</param> /// <returns>True if the errors are equal; otherwise false.</returns> private static bool ErrorsEqual(ErrorItem item, IJSLintWarning error) { var description = string.Concat(Resources.ErrorTextPrefix, error.Message); return(item.Description.Equals(description, StringComparison.OrdinalIgnoreCase) && item.Line == error.Line + 1 && item.Column == error.Column + 1); }
/// <summary> /// Initializes a new instance of the <see cref="JSLintErrorTask" /> class. /// </summary> /// <param name="document">The document.</param> /// <param name="jsLintWarning">The JSLint error.</param> /// <param name="category">The category.</param> /// <param name="hierarchy">The hierarchy.</param> public JSLintErrorTask(string document, IJSLintWarning jsLintWarning, TaskErrorCategory category, IVsHierarchy hierarchy) { this.Document = document; this.Category = TaskCategory.BuildCompile; this.ErrorCategory = category; this.Line = jsLintWarning.Line; this.Column = jsLintWarning.Column; this.Text = GetText(jsLintWarning); this.HierarchyItem = hierarchy; }
public void SetWarnings(int count) { var warnings = new IJSLintWarning[count]; for (int i = 0; i < count; i++) { var number = i + 1; warnings[i] = new JSLintWarningFake(this.FileName, number); } this.Warnings = warnings; }
/// <summary> /// Gets a text representation of the specified error. /// </summary> /// <param name="warning">The error.</param> /// <returns> /// A text representation of the error. /// </returns> private static string GetText(IJSLintWarning warning) { return string.Concat(Resources.ErrorTextPrefix, warning.Message); }
/// <summary> /// Gets a text representation of the specified error. /// </summary> /// <param name="warning">The error.</param> /// <returns> /// A text representation of the error. /// </returns> private static string GetText(IJSLintWarning warning) { return(string.Concat(Resources.ErrorTextPrefix, warning.Message)); }