VisualStudioCodeのデバッグ
このへんの記事を見て気づいたのだが、
Creating Desktop Applications With AngularJS and GitHub Electron
https://hansrwindhoff.wordpress.com/2015/05/05/debugging-task-runner-tasks-like-gulp-with-visual-studio-code-editordebugger/
Debugging task runner tasks (like Gulp) with Visual Studio Code editor/debugger
https://hansrwindhoff.wordpress.com/2015/05/05/debugging-task-runner-tasks-like-gulp-with-visual-studio-code-editordebugger/
VisualStudioCodeは今のところ(Ver 0.10.3)、Node.js と C# mono のデバッグができる。
で、Electronについてだが、Node.js同様に、--debug
を付けることによってデバッグモードで起動するっぽい。
手順
- Electronアプリを
$ electron --debug ./
と、デバッグモードで起動しておく。 - VisualStudioCode で、
app
フォルダを開く。 - 左ペインから、デバッグを選択し、設定を押す。
Node.js
を選択し、launch.json
を作成する。 -
Attach
を選択して起動すると、既に起動済みのElectronアプリと連携する。
ちなみに連携できるのはメインプロセス側で、フロントのBrowserWindow側プロセス(JavaScript)とは連携しない。
メインプロセス側処理はremoteで呼び出せるのだけど、利用方法としてはやや限定的かも。