callawaycloud / generator-ccc

Yeoman Generator for Callaway Cloud Salesforce Projects
19 stars 8 forks source link

Make it easy to debug apex in vs code #18

Closed ralphcallaway closed 4 years ago

ralphcallaway commented 4 years ago

Add a default launch.json so it's easy to debug apex

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
      {
        "name": "Launch Apex Replay Debugger Current File",
        "type": "apex-replay",
        "request": "launch",
        "logFile": "${file}",
        "stopOnEntry": true,
        "trace": true
      },
      {
        "name": "Launch Apex Replay Debugger",
        "type": "apex-replay",
        "request": "launch",
        "logFile": "${command:AskForLogFileName}",
        "stopOnEntry": true,
        "trace": true
      }
    ]
  }
ChuckJonas commented 4 years ago

nice, I've actually been meaning to ask you for this.

I wonder if it's possible to chain task in a way in which you could grab the last log and launch the debugger with it?

ralphcallaway commented 4 years ago

My steps

  1. Sfdx enable replay debugger cmd (sets up the debug log levels so they're ready for replay)
  2. Do something
  3. Sfdx get apex logs cmd, file opens on download
  4. F5

Feels pretty smooth, not sure what else you might be able to optimize. Step 3 is tricky since most of the time there are several debug logs for anything and you have to know which one to pick

On Thu, Feb 6, 2020, 9:22 AM Charlie Jonas notifications@github.com wrote:

nice, I've actually been meaning to ask you for this.

I wonder if it's possible to chain task in a way in which you could grab the last log and launch the debugger with it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ChuckJonas/generator-ccc/issues/18?email_source=notifications&email_token=AAGNKPN2RDTX7KJ6GS3EZKTRBQ2N7A5CNFSM4KQXTSE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK72PHQ#issuecomment-582985630, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGNKPIGX4D2CY6RKWCQXLTRBQ2N7ANCNFSM4KQXTSEQ .

ChuckJonas commented 4 years ago

compared to other languages and even IDE (illumicloud) it still feels like a lot of steps with a bunch of delays in between. Especially when you a deep in a debugging sessions and restarting the process a lot, while trying to hold a bunch of context in your head.

make changes, wait for compile, run test, wait for result, get logs, wait for logs to load, select log, wait for log to download, realize your log levels had expired, run enable replay debugger, wait for log levels to update, start over

I submitted an issue: https://github.com/forcedotcom/salesforcedx-vscode/issues/1291

ralphcallaway commented 4 years ago

yeah, definitely a cool idea, stoked the sf team was already looking at something along that lines

assuming it would have to be a vs code extension to do anything substantial on it ...

ChuckJonas commented 4 years ago

done