Completion List Filtering issue.

SyntaxEditor for WPF Forum

Posted 10 years ago by Heath Morris
Version: 14.1.0602
Platform: .NET 4.5
Environment: Windows 7 (64-bit)
Avatar

I am trying to mimic the behavior of visual studio. where if you type a character the completionlist comes up and begins to filter after the second character is typed. The Session does great if you have an exact match for what you are typing, but if you type something that is in the middle of a word lets say  "egin" and you are looking for the word "begin" how would you create a filter to find these cases where you want to be able to type partial words or middle sections of words and have those remain inside the completion list if there are no matches.

Comments (1)

Answer - Posted 10 years ago by Heath Morris
Avatar

This was the correct answer

Session.MatchOptions = CompletionMatchOptions.UseAcronyms | CompletionMatchOptions.UseShorthand | CompletionMatchOptions.IsCaseInsensitive;

 

protected virtual void OnDocumentTextChanged(SyntaxEditor editor, EditorSnapshotChangedEventArgs e)
{
    if (Session != null)
    {
        if (Session.TypedText.Length > 1)
        {
               Session.CanFilterUnmatchedItems = true;
         }
        else
        {
               Session.CanFilterUnmatchedItems = false;
        }
    }

}

[Modified 10 years ago]

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.