SyntaxEditor Delimiter Auto-Complete Improvements

by Avatar Bill Henning (Actipro)
Tuesday, January 7, 2014 at 4:21pm

PostBannerSyntaxEditorDevNotes

Earlier last year we added delimiter auto-complete features to SyntaxEditor.  Delimiter auto-complete is where the user types a start delimiter and a related end delimiter is auto-inserted after the caret.  This is especially helpful when working on mobile tablets like a Surface since it means less overall typing is required to output the same code.  Best of all, with SyntaxEditor, these features can be easily added to any custom language.

Today I'd like to announce that we have rewritten and made improvements to the internal logic used to track delimiter auto-completions.  This means that as an end user encounters an already-completed delimiter, SyntaxEditor is more intelligent about how to handle various text change operations.

Example 1

Lets check out some of the enhancements.  We'll type in some JavaScript:

DelimiterAutoComplete1

In the screenshot above, the ) character was auto-completed when the ( character was typed.  Now let's type in some parameters:

DelimiterAutoComplete4

Next we will type the ) character even though it already exists in the document.  SyntaxEditor intelligently knows that the ) was previously auto-completed so it moves the caret past it without entering a second ):

DelimiterAutoComplete2

This sort of functionality works in the current SyntaxEditor version however only if there was nothing typed between the delimiters.  In the above scenario with the current version, since we typed in some parameter names, a second ) would have been typed.  With the most recently logic updates, SyntaxEditor now handles real-world scenarios much better.

Example 2

Let's start over to show another nice feature.  Here we've again typed a function and some parameters.  Note that the end ) was auto-completed while typing out the text so it appears after the caret.

DelimiterAutoComplete4

If we Backspace over the text and get to the start ( character, upon Backspacing over that, the related end-delimiter is automatically removed too:

DelimiterAutoComplete5

This feature works in the current version as well but again, only if there was nothing typed between the delimiters.  With the code updates, SyntaxEditor handles many more scenarios of typing within delimiters, and even multiple nestings of delimiters!

Summary

These new features will be available in the 2014.1 version of SyntaxEditor, in the WPF, WinRT/XAML, and Silverlight platforms, and will also appear in the next version of our free Code Writer Windows 8 app.

TaskDownload TaskLiveDemo TaskBuyNow

Actipro's WPF Controls

Over 100 UI controls for building beautiful Windows Presentation Foundation desktop apps.

Learn More

Over 100 UI controls for building beautiful Windows Presentation Foundation desktop apps.

Includes editors, docking windows, MDI, property grids, charts, tree controls, ribbons, gauges, themes, and much more.

Learn More Download Free Trial

Add Comment

Please log in to a validated account to post comments.