This is neat:
How to set a breakpoint in every MessageBox in the application?
But is there a way to do this type of thing for tokens in the task list (menu "View" → "Task List")? For example, I have a code like this:
int a=0;
int b=0;
In the above example, RETEST is the token of the task list; Is there a way to set a breakpoint on all lines that correspond to a specific token of the task list, without having to go to each line where the token was found?
UPDATE
Here is a macro (inspired by How to Add Debug Breakpoints to the Strings Displayed in the Find Results Window in Visual Studio ):
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports System.Diagnostics
Imports System.IO
Imports System.Text.RegularExpressions
Public Module CustomMacros
Sub SetBreakpointsUsingTaskList()
Dim TL As TaskList = DTE.ToolWindows.TaskList
Dim TLItem As TaskItem
For i = 1 To TL.TaskItems.Count
TLItem = TL.TaskItems.Item(i)
Try
DTE.Debugger.Breakpoints.Add("", TLItem.FileName, TLItem.Line)
Catch ex As Exception
' breakpoints can't be added everywhere
End Try
Next
End Sub
End Module