I was once a Add-In / VSIX / MEF developer ...
The answer is no soon, but I have to do it on a long way:
Add-ins, packages (managed or not) have access to the VS service level separately. Each error belongs to the reporter (if they manage it like Chirpy do), so you cannot handle errors created by Chirpy 2.0
I look at the source code several times and save it erros obtained by the tools in the Singleton collection called TaskList.
Collection items are deleted at several points in the latest version using the RemoveAll method:
private static string[] buildCommands = new[] { "Build.BuildSelection", "Build.BuildSolution", "ClassViewContextMenus.ClassViewProject.Build" };
private void CommandEvents_BeforeExecute(string guid, int id, object customIn, object customOut, ref bool cancelDefault) { EnvDTE.Command objCommand = default(EnvDTE.Command); string commandName = null; try { objCommand = this.App.Commands.Item(guid, id); } catch (System.ArgumentException) { } if (objCommand != null) { commandName = objCommand.Name; var settings = new Settings(); if (settings.T4RunAsBuild) { if (buildCommands.Contains(commandName)) { if (this.tasks != null) { this.tasks.RemoveAll(); } Engines.T4Engine.RunT4Template(this.App, settings.T4RunAsBuildTemplate); } } } }
As you can see, exclusion of results depends on many topics. First in the setup (which I donβt know where to install the GUI or configs, but it seems that its value is a checkbox). The second array of names that do not contain each build command name.
So, I see a solution, but only on how to modify and rebuild / remake my own version with Chirpy (and make a Pull request):
The code cannot depend on commands and their names. (e.g. no rebuilds)
You can change the method above like this:
this.eventsOnBuild.OnBuildBegin += ( scope, action ) => { if (action != vsBuildAction.vsBuildActionDeploy) { if (this.tasks != null) { this.tasks.RemoveAll(); } if (settings.T4RunAsBuild && action != vsBuildAction.vsBuildActionClean) { Engines.T4Engine.RunT4Template(this.App, settings.T4RunAsBuildTemplate); } } };
Or with something equivalent to a handler method instead of a lambda expression. You added it to the OnStartupComplete subscription method of the Chirp class.
Unsubscribing must be placed in the OnDisconnection method in the same class. (As with all other signed handlers ...)
Update:
When the add-in is disabled, this does not mean that Studio will be closed immediately. The add-in can be unloaded. Therefore, you should also call RemoveAll from OnDisconneconnection. (Or remove and remove ObjectList ...)
Update2:
You can also create a custom command and bind it to a hotkey.