Javascript remote debugging

Hi,

I'm evalulating Intellij IDEA 8.0.1 and I like what I see.  One feature I can't figure out how to enable is the remote javascript debugging.

I watched the Flash movie on the site that shows how to use the debugger, but to no avail.

Here's my setup:

I have Jetty running locally.  I can successfully debug Java code from that configuration.

I created a remote debugging configuration and entered the URL to a page running in my local Jetty instance.  When I start the debug session the Intellij browser starts, and the page loads correctly in the Intellij web browser.

I then open a .js file in the same project and set breakpoints.

When I click around in the browser, the breakpoints are not being triggered.

What am I doing wrong?

Are there any other movies/documents that explain remote debugging?  I haven't found much to go on.

thanks

-- James

6 comments
Comment actions Permalink

James Cooper wrote:

When I click around in the browser, the breakpoints are being triggered.

Do you mean 'are NOT'?

N.

0
Comment actions Permalink

Currently if you are using a remote debug configuration IDEA cannot find a source file by the URL. So in order to debug you need to press "Jump to
source" button in the browser, then IDEA will open source code of the page in an editor and you will be able to put breakpoints in it.

Hi,

I'm evalulating Intellij IDEA 8.0.1 and I like what I see. One feature I can't figure out how to enable is the remote javascript debugging.

I watched the Flash movie on the site that shows how to use the debugger, but to no avail.

Here's my setup:

I have Jetty running locally. I can successfully debug Java code from that configuration.

I created a remote debugging configuration and entered the URL to a page running in my local Jetty instance. When I start the debug session the Intellij browser starts, and the page loads correctly in the Intellij web browser.

I then open a .js file in the same project and set breakpoints.

When I click around in the browser, the breakpoints are being triggered.

What am I doing wrong?

Are there any other movies/documents that explain remote debugging? I haven't found much to go on.

thanks

-- James

---
Original message URL: http://www.jetbrains.net/devnet/message/5228878#5228878



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Hi Nikolay,

Ah, ok.  I got it working.  My confusion was that the file I wanted to set a breakpoint in was an external .js file.  To make this work I had to:

  1. Have remote debug open the parent page URL
  2. Set a breakpoint in a script tag in the parent page
  3. Load the page -- my breakpoint gets triggered
  4. Step into the function that is contained in the external .js file
  5. Set a breakpoint inside that .js file


At that point I could remove the breakpoint in the parent page and debug the .js file.  It appears that there's currently no way to add a breakpoint inside a .js file without going through the parent page first.  Is that true?

Also, I found that if I edited the .js file, I had to "synchronize" the debugged (locked) version of the .js file in the debugger to get the changes to appear.  Ideally the debugger would automatically reload those changes if they were reloaded in the intellij web browser.

thanks, it's really great to be able to debug javascript in the same IDE as my java code!

-- James

Guest wrote:

Currently if you are using a remote debug configuration IDEA cannot find a source file by the URL. So in order to debug you need to press "Jump to
source" button in the browser, then IDEA will open source code of the page in an editor and you will be able to put breakpoints in it.


--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

James Cooper wrote:

Hi Nikolay,

Ah, ok. I got it working. My confusion was that the file I wanted to set a breakpoint in was an external .js file. To make this work I had to:

  1. Have remote debug open the parent page URL

  2. Set a breakpoint in a script tag in the parent page

  3. Load the page -- my breakpoint gets triggered

  4. Step into the function that is contained in the external .js file

  5. Set a breakpoint inside that .js file


At that point I could remove the breakpoint in the parent page and debug the .js file. It appears that there's currently no way to add a breakpoint inside a .js file without going through the parent page first. Is that true?


Yes, it's true at the moment. We will try to improve usability of remote debugging in the next version.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Nikolay,

I cannot even find where to enter the remote url after clicking on run->edit config->add->application->remote debug.  I attached a screenshot of the dialog.  Can you tell what I did wrong?  Thanks!

BTW I am running IDEA 8.0.1 build 9164.



Attachment(s):
intellij-remote-debug.JPG
0
Comment actions Permalink

You should select "JavaScript Debug" item and then select "Remote" to create a run configuration (see attached screenshot).

Nikolay,

I cannot even find where to enter the remote url after clicking on run->edit config->add->application->remote debug.  I attached a screenshot of the dialog.  Can you tell what I did wrong?  Thanks!

BTW I am running IDEA 8.0.1 build 9164.

---
Original message URL: http://www.jetbrains.net/devnet/message/5229440#5229440


------------------------------------------------------------------------



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.