I'm glad you find the project useful! To get started with Jython code completion, the first thing to do would be to decide whether to "override" the standard Python highlighting (I assume Jython's syntax is a superset of Python's) and use it for Jython, or add your own Jython support. The former is simpler than the latter, and you can change this easily enough later.

Assuming the former, you'll want to examine RSTALanguageSupport project to see how things work. Maybe start with the C support in the org.fife.rsta.ac.c package. That does pretty much nothing but static code completions based off the CompletionXML.dtd you've already discovered, so it's fairly straightforward. You could copy that package as a starting point, for example, and rename the classes accordingly:

Now any RSyntaxTextArea editing SYNTAX_STYLE_PYTHON code should get code completion for whatever you put into your "jython.xml" (or whatever your equivalent of c.xml is named). This should get you any static code completions, for example, keywords or default-package functions (if there are any). You can even add parameter support as seen in the C example.

Once that's working, you could take a step back and look at using classes in the Java language support (org.fife.rsta.ac.java.*) to get code completion for simple Java packages, etc. Be forewarned though - I tried to comment the code well, but it's far from documented. It's also certainly far from perfect, but I consider it "good enough", since even just code completions for members one level deep adds a "wow factor" to an application. In any case, the JavaScript support (org.fife.rsta.ac.js) is probably a shining example of how to grab and use stuff from the Java language support. Another user is graciously implementing JavaScript code completion (using Rhino, though I believe it's pluggable for any JSR223-compliant JS implementation), and his work allows users to point to classes in Java files and get code completion from them. So that would be a good resource.

Feel free to post any specific questions, and good luck!

Hi Greg,

I'm glad you find the project useful! To get started with Jython code completion, the first thing to do would be to decide whether to "override" the standard Python highlighting (I assume Jython's syntax is a superset of Python's) and use it for Jython, or add your own Jython support. The former is simpler than the latter, and you can change this easily enough later.

Assuming the former, you'll want to examine RSTALanguageSupport project to see how things work. Maybe start with the C support in the org.fife.rsta.ac.c package. That does pretty much nothing but static code completions based off the CompletionXML.dtd you've already discovered, so it's fairly straightforward. You could copy that package as a starting point, for example, and rename the classes accordingly:

Now any RSyntaxTextArea editing SYNTAX_STYLE_PYTHON code should get code completion for whatever you put into your "jython.xml" (or whatever your equivalent of c.xml is named). This should get you any static code completions, for example, keywords or default-package functions (if there are any). You can even add parameter support as seen in the C example.

Once that's working, you could take a step back and look at using classes in the Java language support (org.fife.rsta.ac.java.*) to get code completion for simple Java packages, etc. Be forewarned though - I tried to comment the code well, but it's [i]far[/i] from documented. It's also certainly far from perfect, but I consider it "good enough", since even just code completions for members one level deep adds a "wow factor" to an application. In any case, the JavaScript support (org.fife.rsta.ac.js) is probably a shining example of how to grab and use stuff from the Java language support. Another user is graciously implementing JavaScript code completion (using Rhino, though I believe it's pluggable for any JSR223-compliant JS implementation), and his work allows users to point to classes in Java files and get code completion from them. So that would be a good resource.

Hello !First, Thank you for an fantastic project. It's clean, well managed, and a delight to use - (if only IBM took lessons from you, I would be a happier person)Now the Question,I was wondering if you could nudge me in a good direction. I am using RSyntaxTextArea in a swing application. The editor is for Jython. The text area is working great, and I would like to implement code completion in Jython. Besides the Jython keywords I would (at least) like to support a local Java package (through Jython) in the code completion.

Initially I saw a CompletionXML.dtd and was thinking I'd need to write a doclet for my package to have javadoc write it to match the DTD. Then I saw RSTALanguageSupport project.

So to summarize, the "users" of the editor will be writing in Jython, and I'm interested in code completion for (Python keywords + (at least) a couple of local Java packages)

I've downloaded and built all the projects under RSyntaxTextArea (trunk version) (kudos for the clean build process) - Now I was hoping for some sagely advice, before I start hacking and slashing and stepping on things I shouldn't

Kind Regards,Greg

Hello !First, Thank you for an fantastic project. It's clean, well managed, and a delight to use - (if only IBM took lessons from you, I would be a happier person)Now the Question,I was wondering if you could nudge me in a good direction. I am using RSyntaxTextArea in a swing application. The editor is for Jython. The text area is working great, and I would like to implement code completion in Jython. Besides the Jython keywords I would (at least) like to support a local Java package (through Jython) in the code completion.

Initially I saw a CompletionXML.dtd and was thinking I'd need to write a doclet for my package to have javadoc write it to match the DTD. Then I saw RSTALanguageSupport project.

So to summarize, the "users" of the editor will be writing in Jython, and I'm interested in code completion for (Python keywords + (at least) a couple of local Java packages)

I've downloaded and built all the projects under RSyntaxTextArea (trunk version) (kudos for the clean build process) - Now I was hoping for some sagely advice, before I start hacking and slashing and stepping on things I shouldn't :D