コード例 #1
0
        /// <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);
        }
コード例 #2
0
ファイル: JSLintErrorTask.cs プロジェクト: jkorell/jslintnet
 /// <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;
 }
コード例 #3
0
 /// <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;
 }
コード例 #4
0
        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;
        }
コード例 #5
0
ファイル: JSLintDataFake.cs プロジェクト: jkorell/jslintnet
        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;
        }
コード例 #6
0
ファイル: JSLintErrorTask.cs プロジェクト: jkorell/jslintnet
 /// <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);
 }
コード例 #7
0
 /// <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));
 }