Archive for the ‘RSTALanguageSupport’ Category

RSyntaxTextArea (and friends) 2.6.0 Released

Saturday, September 17th, 2016

RSyntaxTextArea, AutoComplete, LanguageSupport, RSTAUI, and SpellChecker all have had version 2.6.0 released today.  These releases include the typical minor features and bug fixes, but also note the migration of these libraries to Java 6.  Starting with 2.6.0, RSTA and friends will require a Java 6 JVM to run.  This should be more than fine, considering it’s 2016.  Folks requiring Java 5 compatibility can continue to use the 2.5.x releases.

Grab them from Maven, GitHub, or SourceForge.

RSyntaxTextArea 2.5.8 Released

Sunday, September 13th, 2015

RSyntaxTextArea, AutoComplete, and RSTALanguageSupport have all been updated to 2.5.8.  Here’s the goodness you’ll get with these releases:

  • Syntax highlighting, code folding, and code completion for less
  • Improves default key bindings on OS X
  • The RSTA jar is now OSGi-compatible
  • Fixes several bugs

You can get ’em (and all other RSTA sister projects) via Maven:

  • com.fifesoft:rsyntaxtextarea:2.5.8
  • com.fifesoft:autocomplete:2.5.8
  • com.fifesoft:languagesupport:2.5.8
  • com.fifesoft:rstaui:2.5.7
  • com.fifesoft:spellchecker:2.5.7


SNAPSHOT artifacts are now available

Friday, January 2nd, 2015

Happy New Year!

SNAPSHOT artifacts are now available for both RSyntaxTextArea and RText, thanks to Sonatype.  This will provide folks with an easy way to try out new versions of these libraries before they are “officially” available.

To use the SNAPSHOTs, you’ll first have to reference the Sonatype snapshot repository.  This can be done in a Gradle build script like so:

repositories {
   maven { // Snapshot builds of RSTA artifacts
      url ''

Then you can just declare your dependencies as usual.  It did seem like I had to be explicit about my desire for 2.6.0-SNAPSHOT, otherwise Gradle/Maven would still fetch the 2.5.6 release artifact:

dependencies {
   compile 'com.fifesoft.rtext:fife.common:2.6.0-SNAPSHOT', 'com.fifesoft:rsyntaxtextarea:2.6.0-SNAPSHOT'


RSyntaxTextArea 2.5.6 Now Available

Wednesday, December 24th, 2014

RSyntaxTextArea and RSTALanguageSupport have a 2.5.6 release on GitHub and Maven!  These releases fix up some issues found in the recent 2.5.4 releases.  They are compatible with the 2.5.4 releases of AutoComplete, RSTAUI and SpellChecker.  RSyntaxTextArea in particular is worth upgrading if your application runs on OS X, because it brings a big performance improvement with rendering tokens with background colors specified.

Moving forward, I hope to more strictly follow semantic versioning, but I give no promises.  But the goal is to no longer tie myself to synchronous releases of all of the RSTA sister projects at once.  All of 2.5.x, for example, should be obviously compatible with one another, and indeed, 2.x should as well.  We’ll see how that goes moving forward.

RSyntaxTextArea 2.5.4 Now Available

Wednesday, November 26th, 2014

RSyntaxTextArea 2.5.4 (and all of its sister projects) are now available on GitHub, Maven and SourceForge!  The biggest change for all projects is the migration from Ant to Gradle for builds.  The primary motivation for this was to make it easier to create artifacts to put into Maven Central, as well as to tinker with something new.  Thus, this is the first release where everything is available in Maven on day 1!  Moving forward, artifacts in Maven will be a standard part of the RSTA release process.

But besides Maven integration, some other goodies were added too, such as syntax highlighting and code folding for Dart and D, as well as simple code completion for XML files.  Check it out!

Code Completion in XML

Friday, October 10th, 2014

I’ve been really, really lazy with adding code completion via DTDs and/or schemas for XML in RSTALanguageSupport, so in the meantime I decoded to add a simpler element/attribute completion scheme.

If you grab the latest from Git, RSTALanguageSupport’s XML support will now offer code completion suggestions for XML element and attribute names:

XML Element Completion

XML Element Completion

How does it decide what to suggest?

For element names, it scans the editor’s contents for any other elements that start with the prefix you’ve typed so far.  For attributes, it scans for other places where you’ve completed an element of the type you’re adding an attribute for; it then suggests any attributes you’ve used for that element elsewhere in the file (and haven’t currently used in the current element):

XML Attribute Completion

XML Attribute Completion

This kind of completion support is pretty handy when you’re editing a larger document, and know you’ve done “the right thing” elsewhere in the file, but cannot recall what it is offhand.  Just let RSTA tell you what to type.  🙂


RSyntaxTextArea 2.5.3 Released!

Sunday, June 29th, 2014

RSyntaxTextArea 2.5.3 was just released on GitHub!  Here’s what’s new:


  1. Improvements to PHP syntax highlighting.
  2. In HTML and XML, “mark occurrences” should match tag names even when the caret is in an attribute, not just when it is in the tag name itself.
  3. Java syntax highlighting updated for Java 8 classes, interfaces, and enums.
  4. SQL: matching opening/closing parens are now highlighted.
  5. Fixed several bugs.


  • Only minor changes to support/stay in sync with RSyntaxTextArea 2.5.3.


  • Only minor changes to support/stay in sync with RSyntaxTextArea 2.5.3.


  1. Improvements to CSS code completion.
  2. Improvements to PHP code completion.  Documentation for many functions is now included.
  3. JavaScriptOutlineTree now understands basic JavaScript OO paradigms much better.


  • Only minor changes to support/stay in sync with RSyntaxTextArea 2.5.3.


  • Added “Recent Files” sub-menu to the File menu.
  • Added an option to install a theme on the RSTA editor when previewing changes to a TokenMaker.
  • Bumped version number in the About dialog to “1.0” to match that in the documentation.



JavaScript Outline Tree is getting smarter

Sunday, June 8th, 2014

The JavaScriptOutlineTree class is getting smarter in the next release of RSTALanguageSupport.

As previously reported a little while ago, the outline tree has recently been able to recognize JS classes created by defining members on a prototype.  That functionality has just been extended in a couple of ways:  first, defining an entire prototype at once is now handled correctly (e.g. adding all fields to a prototype at once):

Recognizing prototypes

Recognizing prototypes

Next, Object.create() is parsed properly; all property descriptors passed in as the second argument to the method are properly added to the desired prototype:

Recognizing Object.create()

Recognizing Object.create()

Further, as the JS parser is smart enough to figure this stuff out now, you can quickly navigate to these newly-identified class members via Ctrl+Shift+O.  Pretty nice!

Only a couple of new things might get added before the next release – code completion for built-in objects such as Math, Object, JSON, etc.  Beyond that, I’d like to add some form of language support for Angular and possibly jQuery, but we’ll see.  As a large part of the JS language support was written by someone other than myself, who hasn’t been active recently, it might take a little bit of time for me to figure out the best way to add such features in (the JS language support is currently designed to support code completion for server-side scripting as well as browser-based JS work, so things aren’t as simple as they might seem).

RSyntaxTextArea 2.5.2 Released!

Sunday, March 9th, 2014

RSyntaxTexArea 2.5.2 was just released on GitHub!  Here’s what’s new:


  1. Whether or not curly braces denote code blocks is now handled on a language-index level, not per TokenMaker. This means TokenMakers such as HTML, JSP, and PHP can provide auto-indentation and curly brace closing for ‘sub-languages’ such as JSP and CSS.
  2. Java syntax highlighting updated for Java 8 classes, interfaces, and enums.
  3. Added “mark occurrences” support for HTML.
  4. Curly braces can now be automatically closed when editing CSS.
  5. The SearchEngine class now automatically selects the next match after a Replace operation.
  6. Fixed errors when loading/saving Theme XML.
  7. Fixed several bugs.


  • Only minor changes to support/stay in sync with RSyntaxTextArea 2.5.2.


  • After doing a “replace” operation with the Replace tool bar, the next valid replacement region is selected in the editor.


  1. The JavaScript language support can now use JSHint for its squiggle underlining of errors and warnings. A .jshintrc file can be specified to override the default JSHint behavior.
  2. CSS code completion.
  3. Fixing bug in XML outline tree for XML files with DTDs specified.

The SpellChecker library was not updated; the 2.5.1 release is still the most current, and is compatible with RSTA 2.5.2.  The idea is that the most recent 2.5.x versions of all of the sister libraries are all compatible with one another.


JSHint integration and more JS features in Language Support

Friday, February 7th, 2014

There are a few handy new features coming for JavaScript developers in RSTALanguageSupport.

Probably the coolest feature is JSHint integration.  By default, the JS support uses Rhino to provide syntax checking, code completion, and an outline tree view of code.  This continues to be the case, but you can now configure RSTA to use JSHint for syntax checking (code completion and outline views are still handled via the AST created by Rhino).  To do this, you can use the following new methods in the JavaScriptLanguageSupport class:

LanguageSupportFactory lsf = LanguageSupportFactory.get();
JavaScriptLanguageSupport jspf = (JavaScriptLanguageSupport)lsf.getSupportFor(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
jspf.setJsHintRCFile(new File("path/to/.jshintrc")); // This is optional

JsErrorParser is a simple enum that allows you to toggle between Rhino and JSHint for error checking.  Once JSHint is enabled, you can optionally point to a .jshintrc file to dictate what errors/warnings should be flagged.  If you don’t do this, JSHint’s defaults are used, but doing so allows you to fully tailor your JS editing experience.

Here’s an example screenshot showing some warnings and errors identified by JSHint, some of which aren’t caught by Rhino:

JSHint Warnings

JSHint Warnings

A word of caution:  currently, the JSHint parser is executed on the EDT.  This means there could be performance issues (most likely just a short pause when the code is re-parsed).  In the next release I plan on rejiggering the RSTA parsing API so such things can be done off the EDT.  But for typical JavaScript files (under a couple of thousand lines) the pause is pretty negligible, and you can always switch back to Rhino in the short term if it is an issue.

Next, the JS outline tree now recognizes JavaScript “classes” built by extending a prototype:

Prototype Support

Prototype Support

This is the first step in making the Outline Tree for JavaScript code smarter and smarter.

Finally, the current function scope of the caret position in a JavaScript file is now outlined in the gutter, similar to what is done for Java.  This is just a small but useful visual cue as to what scope you’re currently working on in the file:

Current Scope in the Gutter

Current Scope in the Gutter

Hopefully the next RSTA/AutoComplete/LanguageSupport release will be in the next couple of weeks.  Look for it soon!