Archive for June, 2013

RSyntaxTextArea and Java 1.4 Support

Sunday, June 23rd, 2013

Does anybody really need Java 1.4 support anymore?  RSTA is one of the few remaining, active Swing libraries that supports this ancient version of Java.  It reached its EOL in 2008 (almost 5 years ago!), and even its extended support ended in February 2013.  Being a syntax highlighting text component, there hasn’t really been anything added to the JDK from Java 5 onward that would benefit it, so I’ve been keeping its minimum JRE version back at 1.4, just to keep it as “compatible” as possible.  However, there are a few drawbacks because of this:

  1. There is one API change in the JDK that occurred between Java 1.4.2 and 1.5 that affects RSTA.  The code in the repository builds cleanly when built with a true 1.4 JDK, but you will receive an error for XmlParser.java when building with Java 5+ (even if you set -source 1.4).  When building RSTA with the included Ant build scripts, you will get a big fat explanation of this spit to stdout, so you know rectify the situation if it happens to you (just add a throws-clause to a single method), but Java novices may not fully understand what’s not working.  Moving the bar up to 1.5 will clean this issue up entirely.
  2. For JavaScript code completion, RSTALanguageSupport has a dependency on Mozilla Rhino, which is developed with Java 5 but offers a 1.4-supporting version, I believe using Retroweaver.  While this is fine and dandy, and everything works, a future version of Rhino may well not include a pre-built 1.4-compliant Rhino jar, and I certainly don’t want to be in the business of building and supporting it myself.  It would be a little nicer if this nuance weren’t there.
  3. One area where the JDK does offer nice new functionality for an editor like RSTA is XML parsing.  We could add schema-based squiggle underline validation to XML files.
  4. It would be a little nice to modernize the code base.

If anyone feels strongly that we should keep releasing pre-built versions of RSTA that run on Java 1.4, please let me know, preferably in the forums.

RSyntaxTextArea – Plans for Next Release

Sunday, June 9th, 2013

Because I haven’t had much time to work on RSTA lately, I’ve been thinking about making a list of work items in an attempt to get motivated.  So here’s what’s on the list so far for the next RSTA release:

  • Performance improvements, particularly for word wrap with very long lines.  This has been asked for a couple of times in the forums.  I’ve done some work, that will be available in the next SVN commit, that will improve performance to some degree.  One of RSTA’s primary issues here is that modelToView()/viewToModel() calculations are relatively expensive, and for very long word-wrapped lines, they are called literally dozens of times whenever text is inserted or the window is resized.  As a first pass, I’m refactoring things a bit so that the data used by these method calls is cached much more aggressively; this seems to improve things quite nicely.  Moving forward, I might also try to minimize the number of calls to these methods in general, though that will be a more difficult task.  There were also some performance improvements made to WrappedLineView.java in the JDK, around the Java 5 timeframe, that RSTA may be able to learn from/graciously borrow.
  • Syntax highlighting for R.
  • Syntax highlighting for .htaccess files.
  • API in AutoComplete libarary to specify the expected type of arguments in a parameterized completion.

Any other suggestions?