SyntaxEditor - Delimiter Highlighting

by Avatar Bill Henning (Actipro) - 2 comments
Thursday, September 6, 2012 at 1:39pm

BlogPostBanner

We're currently working on wrapping up the 2012.2 versions of our WPF and Silverlight controls and hope to have these out in the next several weeks.  Today I'd like to announce another new feature coming to SyntaxEditor in the 2012.2 version:  delimiter highlighting!

UPDATE:  Version 2012.2 is live and available for download now.

What is Delimiter Highlighting?

Delimiter highlighting, also called bracket highlighting, is a feature where highlights appear next to sets of delimiters when the caret is next to them.

DelimiterHighlighting

In the screenshot above, we have the current line highlighting feature active along with delimiter highlighting.  The caret is next to a { character which the C# language implementation recognizes as a bracket that should receive highlighting.  Thus its background is highlighted, along with the matching } bracket's background.

Language-Specific Delimiters

Each syntax language has complete control over which delimiter sets are supported.  The language simply creates a new IStructureMatcher service that is able to locate matching delimiters.

Plus we include a built-in implementation of that service that makes it easy to provide matching for curly brace, square brace, angle brace, and parenthesis pairs.

Multiple Delimiter Support

One feature request we had for the WinForms version (which already has bracket highlighting features) was a good way to support more than two delimiters in a matched set.  This is useful in scenarios where perhaps you want to highlight #if#else#endif.  I'm pleased to say that our delimiter matching feature fully supports and will highlight any number of matches in a delimiter set!

Performance Optimizations

One issue with delimiter highlighting in general is that it updates very frequently, basically with every text or selection change.  In large documents, it can take time to scan forward/backward to find a matching delimiter. 

What we did was to design this feature in such a way that the scanning work is completely offloaded into a worker thread.  It actually piggybacks onto our multi-threaded parsing framework to accomplish this.  Thus in the end, the highlights still show up fast and even when the match scanning takes a relatively long time, there is no detriment to typing or scrolling performance.

Summary

Delimiter highlighting is a visually subtle, yet extremely useful feature when editing code.  It's been highly requested and we're very happy to deliver it in 2012.2.  We think you're really going to like what we've come up with.

In our next post, we'll talk about the related move/select to matching bracket functionality, also coming in 2012.2.

TaskDownload TaskLiveDemo TaskBuyNow

SyntaxEditor .NET Languages Add-on - Async/Await and Iterators

by Avatar Bill Henning (Actipro) - 1 comment
Wednesday, August 29, 2012 at 12:05pm

BlogPostBanner

The latest official C# 5.0 and Visual Basic 11.0 language specifications have added some new keywords and functionality to the languages.  Both languages add asynchronous procedure support (via async/await) and VB adds iterators.

Our upcoming 2012.2 versions of the SyntaxEditor .NET Languages Add-on (WPF and Silverlight versions) have been updated to fully parse the syntax changes and support automated IntelliPrompt on await expression results.

UPDATE:  Version 2012.2 is live and available for download now.

Automated IntelliPrompt for Await

Let's take a look at a sample of async/await in action.  In this sample code snippet, we have a method that will print the row count of a table that is asynchronously returned.

Async

Note how all variables are implicitly declared with the var keyword.  First we declare a dataTask variable that is a Task<DataTable>.  Then we declare a table variable that is the result of an await of the task.

A lot of complicated code is going on behind the scenes here.  First, in order to determine task's type, the resolver has to search the awaited object (dataTask) for a GetAwaiter method (either explicitly declared or declared via an extension method).  If found, it examines that object for a GetResult method and the return value of that is task's type.

Finally you can see from the screenshot that it properly determined that table is of type DataTable since we are able to access the Rows collection on it.

Summary

Our .NET Languages Add-on continues to support the latest syntax innovations and has very impressive automated IntelliPrompt capabilities that can be added to your own applications.  The enhancements mentioned above will be included in the upcoming 2012.2 version.

TaskDownload TaskLiveDemo TaskBuyNow

WPF Controls 2012.1 Build 562 Released

by Avatar Bill Henning (Actipro)
Friday, July 20, 2012 at 12:41pm

BlogPostBanner

WPF Studio 2012.1 build 562 has been released and is now available for download. Several very nice new controls and enhancements are part of this build.

This build has the following major new features:

  • Micro Charts: Added new MicroHeatMapPresenter control that facilitates the creation of heat maps where each cell renders color and/or size differences to reflect data values.
  • SyntaxEditor: Added a new NavigableSymbolSelector control, which can be used to provide type/member drop-down support for a language.
  • SyntaxEditor: Added a INavigableSymbolProvider language service, related types and samples.
  • SyntaxEditor .NET Languages Add-on: Implemented an INavigableSymbolProvider service on both the C# and VB languages, allowing for NavigableSymbolSelector support.
  • All: Improved designer support compatibility with VS 2012.

See the announcement post for the detailed list of enhancements and updates.

TaskDownload TaskLiveDemo TaskBuyNow

WinForms Controls 2012.1 Build 302 Released

by Avatar Bill Henning (Actipro)
Friday, July 20, 2012 at 11:47am

BlogPostBanner

WinForms Studio 2012.1 build 302 has been released and is now available for download. Several enhancements and bug fixes are part of this build, along with improved VS 2012 support.

See the announcement post for the detailed list of enhancements and updates.

TaskDownload TaskBuyNow

Silverlight Controls 2012.1 Build 132 Released

by Avatar Bill Henning (Actipro)
Friday, July 20, 2012 at 8:37am

BlogPostBanner

Silverlight Studio 2012.1 build 132 has been released and is now available for download.  Several very nice new controls and enhancements are part of this build.

This build has the following major new features:

  • Micro Charts: Added new MicroHeatMapPresenter control that facilitates the creation of heat maps where each cell renders color and/or size differences to reflect data values.
  • SyntaxEditor: Added a new NavigableSymbolSelector control, which can be used to provide type/member drop-down support for a language.
  • SyntaxEditor: Added a INavigableSymbolProvider language service, related types and samples.
  • SyntaxEditor .NET Languages Add-on: Implemented an INavigableSymbolProvider service on both the C# and VB languages, allowing for NavigableSymbolSelector support.
  • All: Improved designer support compatibility with VS 2012.

See the announcement post for the detailed list of enhancements and updates.

TaskDownload TaskLiveDemo TaskBuyNow