Issue #156 (Breakpoints in VS Code)04/16/25
Refind: Brain Food, Delivered Daily
Every day Refind analyzes thousands of articles and sends you only the best, tailored to your interests. Refind curates articles from top publications and thought leaders, recommending only the best.
|
After you select your topics of interest, Refind can become a fundamental part of your daily news reading habit, allowing you to easily follow subjects that matter most to you and your work.
|
|
Breakpoints are a ubiquitous feature in many apps and coding environments for debugging code, and of course VS Code includes a
breakpoints feature.
The breakpoints feature in VS Code has had some updates, so I'll just briefly summarize the different types of breakpoints you can use.
The simplest way to add a regular breakpoint is to hover over the line number in your code where you want the breakpoint, then click the little red circle icon that appears.
You can also do the same thing by hitting
F9 on your keyboard with your cursor on the line where you want the breakpoint.
Besides the regular breakpoint feature, VS Code allows you to add a
conditional breakpoint. You can do this by right-clicking in the code editor margin (next to the line numbers) and selecting the "Conditional breakpoint..." option.
This allows you to define a condition that must be met to trigger the breakpoint. From the dropdown menu you can choose either Expression or Hit Count for a conditional breakpoint.
Finally, the third type of breakpoint is called a
triggered breakpoint. This is a type of conditional breakpoint that's enabled when another breakpoint is hit. This feature was added early last year and is sometimes referred to as a nested breakpoint. This is also added by right-clicking the margin and choosing "Add Triggered Breakpoint..."
As shown in the screenshot above, with this type of breakpoint, you'll notice the option "Wait for Breakpoint" is now selected by default. This allows you to select an already existing breakpoint using the dropdown to the right.
For a more detailed discussion of breakpoints, be sure to check out
that section of the VS Code docs.
Now on to this week's hand-picked links!