Example #1
0
        /// <summary>
        /// Collect test compilation errors
        /// </summary>
        public void DisplayTestCompilationErrors(TestProjectPlan projectPlan)
        {
            Package.ErrorList.Clear();
            var errorFound = false;

            foreach (var plan in projectPlan.TestFilePlans)
            {
                foreach (var error in plan.Errors)
                {
                    errorFound = true;
                    var errorTask = new ErrorTask
                    {
                        Category      = TaskCategory.User,
                        ErrorCategory = TaskErrorCategory.Error,
                        HierarchyItem = Package.CodeManager.CurrentHierarchy,
                        Document      = error.Filename ?? plan.Filename,
                        Line          = error.Line,
                        Column        = error.Column,
                        Text          = error.ErrorCode == null
                            ? error.Message
                            : $"{error.ErrorCode}: {error.Message}",
                        CanDelete = true
                    };
                    errorTask.Navigate += ErrorTaskOnNavigate;
                    Package.ErrorList.AddErrorTask(errorTask);
                }
            }

            if (errorFound)
            {
                Package.ApplicationObject.ExecuteCommand("View.ErrorList");
            }
        }
Example #2
0
 public void ShowDiagnostics(Microsoft.VisualStudio.Shell.ErrorTask errorTask)
 {
     broker.ShowDiagnostics(errorTask);
 }
Example #3
0
 internal void RemoveDiagnostics(Microsoft.VisualStudio.Shell.ErrorTask errorTask)
 {
     broker.RemoveDiagnostics(errorTask);
 }