3

Normal breakpoints can be set for a line of AL code in vscode.

The breakpoints can be edited by right-clicking the red dot and choose edit... this allows us to convert it into a "conditional breakpoint" if we insert an AL expression. This makes sure the breakpoint only breaks if the expression evaluates to true, and support for this has gradually been improving in recent versions.

https://learn.microsoft.com/en-us/dynamics-nav/how-to--set-conditional-breakpoints

If we change from "Expression" to "Hit Count" I would expect the breakpoint to break if it has been hit n-number of times.

https://code.visualstudio.com/docs/editor/debugging#_advanced-breakpoint-topics


What I've seen missing, but I'd like to see, is support for Logpoints in AL:

https://code.visualstudio.com/docs/editor/debugging#_logpoints


Since we can already set a conditional breakpoint and manually evaluate an expression in the Debug Console on each hit, can't we make the process easier/quicker by evaluating the expression into the Debug Console automatically if it's a Logpoint instead?


Logpoints would reduce the common need to republish an extension with additional "Message" lines, just to log values at runtime when debugging. They can also be quite powerful when dealing with loops or even replays of a snapshot.


PS. there are commands available in vscode for adding conditional-breakpoints/logpoints, that can be assigned to keyboard shortcuts.


Category: Development
STATUS DETAILS
Needs Votes
Ideas Administrator

Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team