ember-electron icon indicating copy to clipboard operation
ember-electron copied to clipboard

VS Code Debugging

Open eg271 opened this issue 3 years ago • 5 comments

Is it possible to run ember electron using the debugging tools in VSCode? i.e. to set breakpoints, etc.

eg271 avatar May 02 '21 16:05 eg271

Are you asking about debugging the renderer process (Ember app) or the main process?

bendemboski avatar May 02 '21 16:05 bendemboski

the renderer process

eg271 avatar May 02 '21 16:05 eg271

I haven't done it myself (I usually just use the dev tools), but if you run ember electron --- <args go here>, the <args go here> will be forwarded to electron. So I would think that you should be able to follow some standard instructions such as these, except changing it to run ember electron:

              "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ember",
              "runtimeArgs": [
                  "electron",
                  "---",
                  "--remote-debugging-port=9223"
              ],
              "windows": {
                  "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ember"
              }

(and I think keeping the rest the same). I'd love to hear if this works for you so we can add it to the documentation, or if you're up for it, would love a PR adding this to the documentation.

bendemboski avatar May 02 '21 17:05 bendemboski

@bendemboski for the Ember app, wouldn't it be the same as any other Ember app?

RobbieTheWagner avatar May 04 '21 12:05 RobbieTheWagner

@bendemboski for the Ember app, wouldn't it be the same as any other Ember app?

I think so, except it has to be launched via ember electron, and it has to tell Electron to launch the Chromium renderer processes with the right setup...the above is my guess for how to do that, but like I said, I haven't done it myself, and don't have a ton of experience with VSCode launchers/debugging. Have you used VSCode to debug Ember apps running under ember-electron?

bendemboski avatar May 04 '21 13:05 bendemboski