Hi Felix,
Am 19.10.10 13:41, schrieb Felix Meschberger:
Hi,

On 19.10.2010 13:20, Sandro Boehme wrote:
Hi Felix,

Am 19.10.10 08:48, schrieb Felix Meschberger:
o In the Eclipse preferences one needs to map *.esp files to the
JavaScript content type.

Yes. Likewise for *.ecma. Though I have issues setting breakpoints on
*.esp files because on my box Eclipse tells it cannot resolve the line
number to set the breakpoint on.
I had the same problem first. But after adding *.esp to the JavaScript
content type and then opening the esp file with the JavaScript editor it
worked without problems.

I cannot easily find out if the
trigger to load the JavaScript files is already there somewhere.

I guess we only need to trigger the handleCompilationDone() methode
somewhere in Sling but I don't know enough about Sling to decide where
that would fit in or what to configure to make it fit. Maybe it could be
triggered during
...scripting.javascript.internal.RhinoJavaScriptEngine.eval(). Do you
have an idea?

Actually from my traces I see, that the Eclipse rhino.debugger bundle in
facts replies to the compilationDone event and informs the Eclipse
debugger about this.
This sounds good. What did you do to trigger the compilationDone event?
If that works I get some example scripts from the server and can then
try to find a mapping for the paths.

I wrote a simple /apps/nt/folder/html.esp script and then requested a
folder from Sling. This causes the html.esp script to be loaded and thus
the compilationDone event is sent and handled.

I did not have to do anything else.
I tried to load the script with and without the org.apache.sling.scripting.javascript.debug property being enabled (though this should not make a difference). But the compilationDone event is not triggered. Do you have an idea what might be different in your environment?

Best,

Sandro


Regards
Felix




Then the Eclipse debugger is probably supposed to send back breakpoints
for the script but fails to do so because of script path issues: Sling
reports script paths as they exist in Sling, e.g.
/apps/sling/nt/folder.html. Eclipse on the other hand (I am creating a
folder linking to a WebDAV mount of Sling) reports the script path as
the project IPath, that is prefixed with the project name and path to
the linked script folder.

In the end the Eclipse debugger is not able to match the script reported
from rhino.debugger in Sling with the script in Eclipse ...

I once debugged this and "hacked" the correct path into and in fact was
able to break a script and step through it. But we probably really need
some way of mapping the script paths ... I just didn't find out how to,
for example, set a prefix to cut off to get the actual script path from
the project's path.
Thanks for the details.

Best,

Sandro



Reply via email to