Archive for the ‘AutoComplete’ Category

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:

RSyntaxTextArea:

  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.

AutoComplete:

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

RSTAUI:

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

RSTALanguageSupport:

  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.

SpellChecker:

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

TokenMakerMaker:

  • 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.

Enjoy!

 

RSyntaxTextArea 2.5.2 Released!

Sunday, March 9th, 2014

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

RSyntaxTextArea:

  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.

AutoComplete:

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

RSTAUI:

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

RSTALanguageSupport:

  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.

Enjoy!

RSyntaxTextArea 2.5.0 Released!

Monday, August 26th, 2013

RSyntaxTextArea 2.5.0 was just released on GitHub!  The sister libraries AutoComplete, SpellChecker, RSTAUI were updated as well.  Here’s what’s new:

  • The minimum required JRE for the libraries was bumped up to Java 5 from 1.4.  There was no hard requirement for this from a feature point of view, but it allows us to fix a few issues here and there, and modernize the code base, which is a boon for developers.
  • Improvements in both the painting code and syntax parsing code.
  • Added syntax highlighting and code folding for .htaccess files.
  • Bug fixes in JavaScript and Clojure syntax highlighting.
  • The source repositories were (obviously) moved from the old SVN repositories hosted here on fifesoft.com to GitHub.
  • A few other minor changes.

Check it out and let me know what you think!

RSyntaxTextArea repositories now on GitHub, require Java 5

Sunday, August 11th, 2013

Two big things going on with RSyntaxTextArea!

First, the source for RSTA ia being moved from our personal SVN server to GitHub.  Since GitHub is the place to host open source projects these days, hopefully this new home will provide RSTA with more exposure and accessibility.  AutoComplete, SpellChecker, and the other sister libraries are moving over as well.  I haven’t quite decided yet what will happen to the current SVN server; my current idea is to keep it up and available, but to edit the readme files and Ant scripts to talk about the new location (and not actually build anything in the case of the Ant scripts, to force people to notice!).  But I can’t decide whether it’s better to just remove the repository entirely – that will force users to see it’s no longer there, causing them to go to the site and realize the source is now on Github.  While it’s a little more harsh, it will keep the project from appearing “dead” to people who simply monitor the SVN and see no updates being made.

The second big change is that, starting with the next release, RSyntaxTextArea will require Java 5.  Yes, I’m finally retiring support for Java 1.4.  If you still need to run on such an ancient JVM, you can continue to use 2.0.7 (or even fork it on Github!).  If any huge issues are found I’ll be happy to create a maintenance branch based off 2.0.7 for you Java 1.4 folks, but I seriously doubt that’ll happen.

Migrating to Java 5 doesn’t do much for the library itself, but it does modernize the code base, and fixes a couple of odd issues here and there.  You’ll find “java5″ branches in each RSTA project now; that’s where all the action is.  I’m trying to embrace git’s painless branching and all.  :)  When the work is finally done (should be in a day or two) I’ll merge these branches back into master.

Finally, I’ll be adding all known issues into the GitHub issue tracker and any other bits and pieces left remaining.  As an aside, I’ve found GitHub’s interface to be painless, fast, and intuitive.  Much better than the clunky old SourceForge interface.

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?

RSyntaxTextArea 2.0.7 Released

Sunday, April 28th, 2013

RSyntaxTextArea 2.0.7 was just released on SourceForge!  Here’s a list of the cool new stuff:

  • setBracketMatchingEnabled(boolean) now checks for brackets “to the right” of the caret if one is not found “to the left.”
  • Added API for applications to create custom hyperlinks in RSyntaxTextArea, though this API should not be considered stable.
  • Added “mark occurrences” support for XML. Currently just highlights the tag name at the current caret position and its match.
  • Fixed issue when auto-inserting spaces for tabs.
  • Major refactoring of rendering code.
  • “Traditional” selection rendering is now supported; that is, selected text can now be rendered as syntax highlighted tokens with a “selection” background (as it was previously), or as text as a single color with the “selection” background (as standard text components do). See RSyntaxTextArea.setUseSelectedTextColor(boolean).
  • Fixed performance issue in FoldingAwareIconRowHeader when it paints “active regions.”
  • Added some new token types to better differentiate markup tokens from “regular” language tokens. This allows for better syntax highlighting for stuff like HTML, JSP, and PHP.
  • JavaScript highlighting now highlights JSDoc.
  • Added Visual Basic syntax highlighting.
  • In RSTAUI, a new TextFilePropertiesDialog was added.  This dialog shows the currently edited text file’s path, size, word count, encoding, line terminator, and more.  Further, when using a TextEditorPane, you can modify the file’s encoding or line terminator directly from the dialog.
  • RSTALanguageSupport: Miscellaneous JavaScript code completion improvements (thanks Steve).
  • RSTALanguageSupport: JavaScript code now syntax highlights JSDoc.
  • RSTALanguageSupport: JavaScript code completion now offers suggestions for JSDoc when in documentation comments.
  • RSTALanguageSupport: HTML, PHP, JSP and XML now have an option to automatically add closing tags when opening tags are typed (e.g. add “</foo>” when “<foo>” is typed). By default this option is enabled. HTML, PHP and JSP only auto-close tags closeable in the HTML 5 spec; XML closes all tags. This option is separate from the XML “auto-complete closing tag name when ‘</’ is typed” option.

Below are a couple of screenshots showing off the new JSDoc syntax highlighting and code completion.  The first one shows auto-completion kicking in after typing “@” in a documentation comment.  The second screenshot shows the parameterized assistance you get for “@param”:

JSDoc Code Completion

JSDoc Code Completion

JSDoc Parameterized Completion in action

JSDoc Parameterized Completion in action

Go check it out!

RSyntaxTextArea 2.0.6 Released

Wednesday, January 23rd, 2013

RSyntaxTextArea 2.0.6 was just released on SourceForge!  Included are new versions of AutoComplete, RSTALanguageSupport, and SpellChecker.

RSTA now provides syntax highlighting and code folding for JSON:

JSON Support

JSON highlighting and code folding in RSTA

Further, the AutoComplete and RSTALanguageSupport libraries now look good in Substance (in particular, Insubstantial).  Previously, these libraries used DefaultListCellRenderer for their completion choices.  Substance, being the barrel of fun that it is, forces libraries to extend its own DefaultSubstanceListCellRenderer, otherwise they aren’t rendered with Substance’s striping, gradients and rollover effects.  Now, RSTA and its cousins detect when Substance is the current Look and Feel, and render with a DefaultSubstanceListCellRenderer when necessary.  Easy peasy!

 

Substance in AutoComplete Popups

Substance in AutoComplete Popups

(Pardon the fact that I didn’t update the editor color scheme to be dark as well!).  This is done via reflection, so there is still no build dependency on Substance.  This of course assumes that the DefaultSubstanceListCellRenderer class name and package don’t change in future releases of Insubstantial, but I highly doubt that’ll happen, considering it’s a maintenance fork of the original Substance.  And if something goes horribly wrong, the library should fall back into its default rendering path anyway.

The outline trees (JavaOutlineTree, XmlOutlineTree, etc.) still use DefaultTreeCellRenderer, but applications can use the same technique here – wrap the standard renderers for these components with SubstanceDefaultTreeCellRenderer, call delegate.getTreeCellRendererComponent(), then set the Substance renderer’s icon and text based on the delegate’s values.  Come to think of it, I’m not sure why I didn’t have the libraries automatically delegate like I did with the completion choices lists… maybe next release.  One thing you do lose from this delegation is the rollover effect – the render “looks” the same, but the animated rollover effect depends on the actual renderer being a DefaultSubstance*Renderer.  Since we’re only *delegating* to one, we’ll look like it, but won’t get the rollover effect.

RSyntaxTextArea 2.0.5.1 Released

Monday, December 17th, 2012

RSyntaxTextArea 2.0.5.1 was just released on SourceForge!  This release fixes the problem with typing the ‘/’ character on non-QWERTY keyboards, so is a must-upgrade if you’re using 2.0.5 (2.0.4 did not have this bug).  It also updates the Arabic translation (thanks Mawaheb!).

The AutoComplete, SpellChecker, and RSTAUI add-on libraries were also updated with Arabic translation updates.