Search code examples
javascriptdebuggingintellij-idearemote-debuggingwebstorm

Webstorm Remote Debugging + edit local javascript file while debugging


I've been working through the javascript remote debug tutorials for WebStorm / IntelliJ(numbers.js)

I've managed to get remote debugging working successfully, however there is one thing that is making life difficult.

When I'm debugging numbers.js in WebStorm(I've also tested in IntelliJ and have same result) there is a little lock icon which I guess implies that the file is read only. At the moment, it is slow and painful to go full cycle on the development / deploy process of:

  1. code modification on local file
  2. upload
  3. debug on locked remote fuile
  4. switch tabs in WebStorm to local file
  5. code modification on local file

What I want to do at least is debug on local file, so that I can make changes while debugging and then quickly upload and repeat.

@ the tutorial http://wiki.jetbrains.net/intellij/Remote_JavaScript_debugging_with_WebStorm_and_PHPStorm

the numbers.js file does not have the locked symbol in the tab like I am seeing in my locally running WebStorm.

Anyone else have this problem? Anyone advise how they got WebStorm working so they can make changes to the local file while stepping through and debugging?

Thanks


Solution

  • Most likely you open the file from the Scripts tab in the Debugger panel and place breakpoints there. You should place breakpoints in the original file instead.

    Deployment can be automatic (on Save) or you can use In Place configuration when your server root is configured to the project folder.

    Another important thing is the local file to remote URL mapping in the Debug configuration. Note that in the wiki tutorial Remote URL is set to the full URL including the http:// and server name.

    With In Place deployment or with Automatic Upload and correct mappings you can debug your scripts with zero turnaround time. Make a change, switch to a browser, Refresh (file is saved automatically as Settings | General | Save files on frame deactivation is enabled by default).

    If it doesn't work this way for your project, please contact JetBrains support and send a sample project to reproduce this problem, also describe your server and deployment settings.