SyntaxEditor - XML End Tag Completion

by Avatar Bill Henning (Actipro)
Friday, January 30, 2015 at 9:59am

PostBannerSyntaxEditorDevNotes

Let's have a look at a new feature that came to the advanced XML language for SyntaxEditor for WPF (via its Web Languages Add-on) in the latest 2014.2 maintenance release: the ability to auto-complete XML end tags.

Feature Description

The advanced XML language already has auto-end tag insertion features that occur as you type the > character at the end of a start tag.  In that scenario, the end tag is inserted immediately after the caret.  There are other times where you have deleted some text that may include an end tag that you wish to type back in again.

Say that you are editing a block of XML and start to type an end tag.  After typing the < character, the completion list will contain an item for closing the nearest open ancestor element (if any):

SyntaxEditorEndTagAutoComplete1

In the example above, you can see the "/colors" item in the completion list and how selecting it auto-completes the end tag.

End tag auto-completion also works if you put the caret after a </ and press Ctrl+Space, as in this example:

SyntaxEditorEndTagAutoComplete2

In the example above, Ctrl+Space is pressed at the caret's location to auto-complete the "colors>" text.

Summary

The features described above were added in the latest v2014.2 maintenance releases of our WPF Controls and are available for use.

TaskDownload TaskLiveDemo TaskBuyNow

Tags: wpf, syntaxeditor

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.