How to customize the completion list

SyntaxEditor for WPF Forum

Posted 15 years ago by Gustavo Guerra
Version: 9.1.0503
Avatar
Greetings.

Could you help me implementing this 3 things? I'm didn't find anything on the documentation or the samples:

1) Select the first item as soon as the completion list appears

2) Filter out items that don't match as I start typing (like this: http://www.screencast.com/t/aa4eqxqa)

3) Remove the focus rectangle on the completion list.

How can I do that?

Best Regards,
Gustavo Guerra

Comments (6)

Posted 15 years ago by Gustavo Guerra
Avatar
I also want to highlight the current text when starting completing by ctrl+space.

if (e.Key == Key.Space && e.KeyboardDevice.Modifiers == ModifierKeys.Control) {
var reader = ActiveView.GetReader();
var token = reader.ReadTokenReverse();
...
session.Open(
ActiveView,
token == null ?
new TextRange(ActiveView.Selection.EndOffset) :
new TextRange(token.StartOffset, token.EndOffset));

If I execute this with the text "Se" and the caret at the end, I get an ArgumentOutOfRangeException. If I execute this with the text "Se ", it gives me the "Se" token instead of the " ".

Best Regards,
Gustavo Guerra
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Gustavo,

It seems like you are trying to eliminate "partial" selections (focus rectangle only), right? The problem is that there are two cases where those show up. If you show a completion list without any initialization text, it will partially select the first item. You can force that to a full selection following your call to the session's open method by code like this:
session.Selection = new CompletionSelection(session.Items[0], CompletionSelectionState.Full);
However if the user starts typing "zzz" and nothing matches that then a new partial selection will be created. So there is no way to eliminate partial selections.

Dynamic filtering of options is something that we've actually just completed and have ready for the next build. Check our blog for a post today on this.

As for your other question, we'd need you to make a simple sample project that shows the issue and email it over so we can look at what is happening.


Actipro Software Support

Posted 15 years ago by Gustavo Guerra
Avatar
Is it possible to disable partial matches and only show full matches?

Best Regards,
Gustavo Guerra
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Gustavo,

Well the distinction between no, partial and full matches is pretty key to the functionality. Why wouldn't you want partial matches? They seem to be a very beneficial feature for end users.

Perhaps you can explain in more detail about what you are trying to achieve and why. Thanks.


Actipro Software Support

Posted 15 years ago by Gustavo Guerra
Avatar
What I really want is to make partial matches behave & look like full matches, so there's always something selected in the completion list ready to be commited on the press of enter.

Best Regards,
Gustavo Guerra
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Gustavo,

We can add this to the TODO list however this will likely be a low priority item. If it's something that you require immediately, you can contract us to implement it for you. See this URL for more info if you are interested in that:
http://www.actiprosoftware.com/Purchase/ConsultingServices.aspx


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.