Hi
I'm currently implementing an Eclipse Javascript Editor which should
provide code assist functionality, e.g. a list of available methods/
fields and parameters. Since Rhino1.7R3 should be released with the
new AST API I checked the source code on how I could extract the JAVA
type that underlies my javascript variable. The JAVA types are mostly
out of external JAVA packages. In principle a user should be able to
click anywhere in the code, and I would based on the offset determine
the AST element and resolve the JAVA type - to extract the list of
available members.
Based on the rhino source code I'm not sure if this is possible at
all, and if yes, what would be the recommended way to implement such a
functionality.
As far as I understood, due to the weakly typed nature of javascript,
rhino will resolve the Java types only at runtime, is this correct? So
there is probably no way to extract the type information based on the
AST?
If I use the higher level calls for embedding the rhino/javascript-
source in my Java project, i.e.
...
cx.evaluateString(scope, s, "<cmd>", 1, null);
Object x = scope.get("x", scope);
...
, I don't see how to access elements based on the actual javascript
source code positions, and how to access local variables within
functions.
Am I looking into the wrong direction? Any help appreciated...
Thanks in advance
Stefan
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino