“IntelliPrompt completion list” week continues with today’s hot new feature: matching algorithms.
Matching algorithms are what are used to select an item in the completion list as you type in the editor.
Default matching algorithm
Normal completion lists match with an algorithm in which the typed characters are compared against the start of each item like in this screenshot:
|

“GetHashCode” is matched because it starts with the text “get”
|
The default algorithm has the highest priority when attempting to match items. If no match is made, the next active algorithm is used.
Acronym matching algorithm
Next in priority is an optional algorithm in which the first and every uppercase letter is examined for a match.
|

“GetType” is matched because the “gt” matches the uppercase letters in the word “GetType”
|
For words that contain underscores, the first and every character following an underscore are examined for a match instead.
If no match is made, the next active algorithm is used.
Shorthand matching algorithm
Next in priority is another optional algorithm in which the supplied text provides a wildcard sort of pattern. A match is made if all the characters appear somewhere in the item text.
|

“IntValueChanged” because the “val” and “ch” (which make up the typed “valch”) are both in the word “IntValueChanged”
|
Shorthand provides the most flexibility since it allows substring matches anywhere in the items.
If no match is made, the fallback algorithm is used.
Fallback partial matching algorithm
Finally if no match as been made yet, a partial match can be made at the item that starts with text closest to the typed text.
|

“GetHashCode” is partially matched because the first “g” matches the starting “G” in “GetHashCode”
|
Case sensitivity
By default, matching is done such that matches that actually match the case of the typed text are returned first. If none are found, an insensitive match is returned instead.
This default can be disabled so that insensitive matches are always used.
Match target text
Completion list items each have display text and text that is actually inserted into the document. By default the text that will be inserted into the document is matched against. However you can change it to match against the display text if you prefer.
Note that in most cases, the display text and text to insert actually are the same thing.
Summary
As you can see, the multi-algorithm approach provides some really nice functionality for end users. And there are plenty of other options so that you can tailor the user interface how you wish.
These are just some of the advancements we’re making in SyntaxEditor for WPF that make all the difference between our product and the competition.