Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363395 - Firebug console messages do not appear in Eclipse any longer
Summary: Firebug console messages do not appear in Eclipse any longer
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: 3.2.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Michael Rennie CLA
QA Contact: Michael Rennie CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 367806
  Show dependency tree
 
Reported: 2011-11-09 17:11 EST by Leopoldo (Polo) Miranda CLA
Modified: 2012-01-03 19:45 EST (History)
2 users (show)

See Also:


Attachments
jsdt patch (6.21 KB, patch)
2011-11-25 12:40 EST, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Leopoldo (Polo) Miranda CLA 2011-11-09 17:11:22 EST
1. Create a simple static web project, that contains the following:
- A JS file/function that has five lines of code for example:

 function errorMakersFunction() {
	console.log('About to hit an error maker in RAD...');
	callingAnUnexistingFunction();
	console.log('Set a breackpoint here and check in RAD Problems View');
}
- An HTML that contains a button with onClick event to call the JS function
above

<button type="button" onClick="errorMakersFunction();">Click Me!</button>


2. Deploy your web project in any web container.
3. Open the URL for the html page in Firefox (Firebug up and running and
Crossfire   already listening)
4. In Eclipse create a new Remote JavaScript configuration as follow:
- In Connect tab, select "Crossfire - Remote Attach" and leave all defaults
- In the Source tab, delete the Default "Source Lookup Path" and add your
sample project (or workspace) instead.
5. Start to "Debug"
6. Go to Firebug, and select the script tab and set a break in the following line

callingAnUnexistingFunction();

7. Click in the button so then your JS breakpoint is reached.
8. Accept the Eclipse notification to go to debug mode (if not there already)
9. You will have the JS open in the JS file in the edit view.
10. Click "Step Over (F6)"

Current Behavior:

JS errors like calling an unexisting function are not reflected in the Eclipse problem view, however, those appears in the firebug console.

Expected Result:

Error makers should also be synch'ed from FB console to Eclipse Problem View.

Firefox versions either 7
Firebug 1.8.3
Crossfire 0.3a9
Comment 1 Michael Rennie CLA 2011-11-16 10:10:19 EST
(In reply to comment #0)

> Current Behavior:
> 
> JS errors like calling an unexisting function are not reflected in the Eclipse
> problem view, however, those appears in the firebug console.

After investigating this, I found that the crossfire extension is no longer sending any of the onConsole* events OTW. Looks like this is a known issue in Crossfire - http://code.google.com/p/fbug/issues/detail?id=4269

Also, I wondered if it might be better to allow users to decide how the messages are displayed, and/or allow someone to plug-in their own error message handler.
Comment 2 Michael Rennie CLA 2011-11-16 10:14:49 EST
(In reply to comment #1)
> . Looks like this is a known issue in
> Crossfire - http://code.google.com/p/fbug/issues/detail?id=4269

For reference, here are the events we should be getting:
http://getfirebug.com/wiki/index.php/Crossfire_Protocol_Reference#Console_Tool_Events
Comment 3 Michael Rennie CLA 2011-11-25 12:39:38 EST
I have fixed the Crossfire extension here: http://code.google.com/p/fbug/source/detail?r=12341

and will attach a small patch for the JSDT side of things
Comment 4 Michael Rennie CLA 2011-11-25 12:40:25 EST
Created attachment 207547 [details]
jsdt patch
Comment 5 Michael Rennie CLA 2011-11-25 12:41:15 EST
I have applied the patch to HEAD.