CanCommitWithoutPopup: Auto commit raised even with more than one match.

SyntaxEditor for WPF Forum

Posted 6 years ago by Timo Emondts
Version: 11.2.0555
Avatar

From the documentation:

> Gets or sets whether the session can immediately commit if a single match is made when the session is opened.

Based on this, auto commit should only be raised if there's a single match. But there's a simple reproducable scenario in which auto commit is raised although more than one completion item matches.

This is reproducable with the example of SimpleCompletionProvider (GettingStarted10).

Ensure following properties are set:

session.CanCommitWithoutPopup = true;
session.MatchOptions = CompletionMatchOptions.UseShorthand;
session.CanFilterUnmatchedItems = true;

Run SampleBrowser and select the example. Add two functions:

function Image() {}
function Max() {}

Now call auto completion with CTRL+SPACE first. With the open completion list, type "ma". There are three results. Image, Max and IncrementAndMultiply. Press escape and then raise auto completion again with CTRL+SPACE.

Although, based on the MatchOptions, we should find three matches again, the commitment is automatically raised. This will, of course, not happen if there's a second method starting in "Ma", like "function Math () {}"

Auto commit seems only to count matches that starts with the respective text and ignores other matches.

What can I do, to ensure auto commit occurs only when we have a real single match?

Comments (1)

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

Hi Timo,

Thanks for the example.  What happens is that it's finding a unique match in the first matcher (the starts-with one) and it quits at that point.  We've updated our code for the next maintenance release to also examine subsequent matchers to see if they have any matches.  That fixes this issue.


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.