/// <summary>
 /// Initializes a new instance of the <see cref="JSLintErrorTask" /> class.
 /// </summary>
 /// <param name="document">The document.</param>
 /// <param name="jsLintError">The JSLint error.</param>
 /// <param name="category">The category.</param>
 /// <param name="hierarchy">The hierarchy.</param>
 public JSLintErrorTask(string document, IJSLintError jsLintError, TaskErrorCategory category, IVsHierarchy hierarchy)
 {
     this.Document = document;
     this.Category = TaskCategory.BuildCompile;
     this.ErrorCategory = category;
     this.Line = jsLintError.Line - 1;
     this.Column = jsLintError.Character - 1;
     this.Text = GetText(jsLintError);
     this.HierarchyItem = hierarchy;
 }
Example #2
0
        public void SetErrors(int errorCount)
        {
            var errors = new IJSLintError[errorCount];

            for (int i = 0; i < errorCount; i++)
            {
                var number = i + 1;
                errors[i] = new JSLintErrorFake(this.FileName, number);
            }

            this.Errors = errors;
        }
        /// <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, IJSLintError error)
        {
            var description = string.Concat(Resources.ErrorTextPrefix, error.Reason);

            return item.Description.Equals(description, StringComparison.OrdinalIgnoreCase) &&
                item.Line == error.Line &&
                item.Column == error.Character;
        }
Example #4
0
 /// <summary>
 /// Gets a text representation of the specified error.
 /// </summary>
 /// <param name="error">The error.</param>
 /// <returns>
 /// A text representation of the error.
 /// </returns>
 private static string GetText(IJSLintError error)
 {
     return(string.Concat(Resources.ErrorTextPrefix, error.Reason));
 }
 /// <summary>
 /// Gets a text representation of the specified error.
 /// </summary>
 /// <param name="error">The error.</param>
 /// <returns>
 /// A text representation of the error.
 /// </returns>
 private static string GetText(IJSLintError error)
 {
     return string.Concat(Resources.ErrorTextPrefix, error.Reason);
 }