We’re really excited to announce a new option coming in the next SyntaxEditor for WPF build that automatically filters out items in a completion list that don’t match the currently typed text. This feature can be seen in action when editing Visual Basic code in Visual Studio 2008. The completion list essentially hides items that can’t be matched with the text you’ve typed, allowing you to drill down and focus on the important items instead of keeping the entire list of items visible.
The next build introduces a new ICompletionSession.CanFilterUnmatchedItems boolean property that when set to true enables this feature. We’ve also updated our completion list filtering QuickStart in the next build to show off the feature (see highlighted CheckBox):
Unmatched item filtering in action
Let’s walk through an example to show how it works.
We press Ctrl+Space to show the completion list. No text is used to initialize the list so all items are visible.
We now type an i character, which removes a number of items that don’t contain an i in them. Note that in this sample we have our acronym and shorthand item matchers active, not just the standard starts-with item matcher. Therefore if an i is found anywhere in an item’s text, it will be considered matchable.
Next we type nt which makes our typed text value int. This removes the ToString item from view since that doesn’t match the typed text in any way.
Now we type c, so this eliminates some more items. You can see the shorthand item matcher clearly working on these remaining items. Think of shorthand as this sort of regular expression: i*n*t*c. Thus you can see why the remaining two items are still available.
Now we type a z character. Since z doesn’t appear in any of the items, our list is empty. If we backspace to remove the z we come back to this screen:
This dynamic auto-shrinking feature has been requested by numerous customers so we’re very happy to finally provide it.
Other enhancements
The next build also has some improvements to the speed of the completion item matchers, meaning that both completion list selection updating and matched text highlight render performance have been improved.
You can see the matched text highlight feature in the screenshots above. They render the matched text in each item in a separate color so you can see how each item was matched.
Summary
With this new feature addition, SyntaxEditor for WPF’s completion list feature set now encompasses about everything found in major products such as Visual Studio and even the most popular productivity add-ins for VS. Enjoy the new option in the next build!