Possible Selection bug with CompletionSession

SyntaxEditor for WPF Forum

Posted 8 years ago by Kasper
Version: 11.1.0545
Platform: .NET 4.0
Environment: Windows 7 (64-bit)
Avatar
Hi guys,

I'm trying to guess which item my user wants from the completion list, based on some logic. I then use the following code to pre-select this item, if possible:

if(itemToPreSelect != null)
    completionSession.Selection = new ActiproSoftware.Windows.Controls.SyntaxEditor.IntelliPrompt.CompletionSelection(itemToPreSelect, ActiproSoftware.Windows.Controls.SyntaxEditor.IntelliPrompt.CompletionSelectionState.Full);
completionSession.Open(editor.ActiveView);
However, even though I have specified the Full selection state, the item is only partially selected, meaning that I have to press the first letter of the item to have it fully selected. I want it fully selected immediately, which is also what I would expect from the above code. Am I missing something? :)

Comments (1)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Kasper,

By calling the Open(view) method, it will attempt to initialize the list based on the identifier, if any, that you are typing in at the time. You might try using the other overload and passing it an empty TextRange where both Start/EndOffset are the caret's offset. I'm not sure if that will work around your issue or not but it's worth a try.

Otherwise, you could probably set the selection right after the Open call instead.


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.