RSyntaxTextArea+SYNTAX_STYLE_JAVASCRIPT

General Discussion on RSyntaxTextArea.

Moderator: robert

RSyntaxTextArea+SYNTAX_STYLE_JAVASCRIPT

Postby pavel.kotala » Thu Sep 06, 2012 7:33 am

Hallo everybode,
I am not sure if this is right forum, but I have not found any other.

We use Java scripting and I just added JavaScript editor into our new application using RSyntaxTextArea and LanguageSupportFactory.

It works fine when using autocomplete for global classes like Math, Number, etc.

I would like it would work also for classes and variables that are bound using engine put() method when evaluating javascript using java scripting, like:

java code:

engine = new ScriptEngineManager().getEngineByName("JavaScript");
engine.put("obj", new MyClass());


So when i type obj. in editor, it would suggest methods of MyClass.

As I guess there is no support at this time. Is there any way to add them to JavaScriptAutoCompletion? I could list available classes and methods, but I do not know, how to bind them to JavaScriptAutoCompletion.

Thank you
Pavel
pavel.kotala
 

Re: RSyntaxTextArea+SYNTAX_STYLE_JAVASCRIPT

Postby robert » Thu Sep 06, 2012 1:25 pm

This is a good idea. Please add a Feature Request on the project's SourceForge page so this can be tracked.
User avatar
robert
 
Posts: 802
Joined: Sat May 10, 2008 5:16 pm

Re: RSyntaxTextArea+SYNTAX_STYLE_JAVASCRIPT

Postby Chad » Thu Sep 06, 2012 11:37 pm

I also think that's a great idea and I'd like to see that feature as well. Is there any way that this could be generic enough to work with any language that has LanguageSupport available? I use ScriptEngineManager as well with Beanshell, JACL (TCL), Jython, JS, etc.
Chad
 

Re: RSyntaxTextArea+SYNTAX_STYLE_JAVASCRIPT

Postby robert » Fri Sep 07, 2012 2:29 pm

In order for it to be added to Beanshell, etc., those languages would also need LanguageSupport implemented for them, and that isn't too high on the priority list at the moment, unfortunately. Beanshell might be easier than others, since my understanding is it's very close to Java (moreso than Groovy, for example), and thus could likely use the WIP Java parser.
User avatar
robert
 
Posts: 802
Joined: Sat May 10, 2008 5:16 pm


Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 5 guests