AutoComplete instance of an object

General Discussion on RSyntaxTextArea.

Moderator: robert

AutoComplete instance of an object

Postby TeeBee » Mon Jun 14, 2010 10:02 am

Hi all,
I hope this is the right thread for my question.
I am writing a JavaScript Editor with Rhino + rsyntaxtextarea + autocomplete and I need to autocomplete methods and variables for instance of classes.
Is this possible?

Here is an example of Script that I may use

//instance of "Semaphores" Java class through Rhino engine
//this class has several methods
var sem = new Packages.Semaphores();

//here i would like to have code completion
sem.


Thanks!
TeeBee
 

Re: AutoComplete instance of an object

Postby robert » Mon Jun 14, 2010 12:17 pm

This is doable, but it takes a lot of work. The only example of semantic completion at the moment is the JavaCompletionProvider in the RSTALanguageSupport project. It works well but still has some harsh limitations - there's still a lot of work to be done. But feel free to check it out. If you wanted to add semantic completion for JavaScript, you'd want to create a LanguageSupport implementation similar to JavaLanguageSupport, and a Parser similar to JavaParser that is capable of parsing JavaScript into an AST, that can then be used to determine the appropriate code completions.
User avatar
robert
 
Posts: 774
Joined: Sat May 10, 2008 5:16 pm


Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron