要件
VsCodeでApexのDebugはどうやってできるか
参照資料
要点
JavaのVersionが限定されていること
これはVscodeの制限です。Versionが合わないとDebuggerだけではなく、関数のJumpなどもできない
Breakpoits と Checkpointsの区別
Checkpointsは特別Breakpointsです。その点のStack、Heapの詳しい情報をめもされる
Checkpointsは最大5個です。アイコンも違います。(〇に横線 → Checkpoints)
Sfdxのtoggle checkpointsコマンドで、設定する
STEP
① Install Vscode, Salesforce CLI
install Java (JDK version 17 (Recommended), JDK version 11, or JDK version 8)
-> JAVA_HOME
-> File > Preferences > Settings (Windows or Linux) or Code > Preferences > Settings
apex java
salesforcedx-vscode-apex.java.home
② Create Sf project
create Apex class
create Apex TestClase and deploy to org
( Ctrl shift P)
③ Debug
・Set Breakpoints and Checkpoints
( そのBreakpointラインを選択し、SFDX: Toggle Checkpoint、アイコンが変わる)
・SFDX: Update Checkpoints in Org
・SFDX: Turn On Apex Debug Log for Replay Debugger
・テストクラスを実行する(コマンドか、クラスのアノテーションか)
・SFDX: Get Apex Debug Logs
・Replay an Apex Debug Log