Debugging using the Apex Replay Debugger
The Apex Replay Debugger is a tool that allows a developer to replay a set of code that has been run to debug it at particular breakpoints. You can gain a deeper insight into the code as it runs and can inspect any variables for their values within VS Code. The Replay Debugger allows you to have up to five breakpoints within your code, so it has to be used with this in mind.
To use the Replay Debugger, perform the following steps:
- Open your org and ensure that your user has no debug logs turned on.
- Once you have done this, return to your VS Code project and apply a set of checkpoints to your code. This is done by clicking on the gutter of the file (this is the area to the left of the line numbers).
- A red dot will appear signifying a breakpoint has been created, as is shown for the singleton instance we discussed previously, and shown in the following screenshot. Note that there is a difference in terminology between VS Code...