Custom filters are not updated if canFilterUnmatchedItems false

SyntaxEditor for WPF Forum

Posted 6 years ago by Timo Emondts
Version: 13.1.0581
Platform: .NET 4.5
Environment: Windows 8 (64-bit)
Avatar

I created a custom filter which basically does the same as what happens if "canFilterUnmatchedItems" is true. 

In case of "canFilterUnmatchedItems == false" my custom filters works as expected when I type the first character but is not updated when I continue typing. 

Having had a look into code I've seen that none of the custom filters are called again on TextChange. Only call occurs immediately after creating a new session. 

If I set the property to true again, everything's as I expect. My custom filter is called each time I type another character.

Comments (3)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Timo,

For something like this, we'd need to have a new simple sample project to debug with.  Can you make one and email it to our support address?  Please reference this post and rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 6 years ago by Timo Emondts
Avatar

Actually, this is very simply reproducable with your sample browser and the IntelliPrompt Completion List example (GettingStarted10).

1. Copy & paste your DynamicCompletionFilter to that file, or change visibility to public.

2. Set these settings:

session.CanFilterUnmatchedItems = false;
session.Filters.Add(new DynamicCompletionFilter());

The completion list filter will not work as expected.

I debugged into code anyway, and I guess I know the cause:

File CompletionSession.cs, method UpdateSelectionForText:

if ((completionList != null) && (canFilterUnmatchedItems)) {
  if (completionList.ApplyFilters()) {...}
}

With canFilterUnmatechedItems == false filters are not updated because the ApplyFilters method, which refreshes view, is not called.

Removing the second condition fixed this issue on my machine.

[Modified 6 years ago]

Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Timo,

For the 2013.2 version, we'll be adding a ICompletionSession.RequiresFilterOnTextChange property that can be set to true to ensure filters are applied after any text change.  That will help with your scenario.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) 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.