IntelliPromptMemberList Complete Method

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
The 'Complete' method for the IntelliPromptMemberList class is supposed to complete the current operation (which I assumed to mean that it simulates the selection of an item in the list). It appears this method only works if the IntelliPromptMemberList is visible.

I'm currently working on the Complete Word IntelliSense feature. Essentially, this feature does a lookup on the currently available IntelliPromptMemberListItems and, if one and only one item begins with the word to be completed, it performs the same operation as if the user had selected that item from the IntelliPromptMemberList. If no single match is found, the IntelliPromptMemberList is shown for the user to select the appropriate item. This basically means that I have to build the entire member list anyway even if it's never shown.

If it turns out that I have a single match and do not need to show the IntelliPromptMemberList, I would like to be able to set the 'SelectedItem' property of the IntelliPromptMemberList and then call the 'Complete' method to simulate the selection of that item from the list. Unfortunately, this doesn't seem to do anything since the list is not visible.

There is a work-around in the I can perform an UndoableInsert for the selected item, but then I have to re-invent the process of determining the before/after text and moving the caret. If the behavior of the IntelliPromptMemberList ever changes, I'll also have to remember to update the Complete Word process. It would be a lot easier if I could just call the 'Complete' method without ever showing the list.

What do you think? Is this doable?

Comments (4)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The only problem is that there are some internal things stored when you call Show, like the offset/length of the range to use for replacement. Somehow that needs to get set.

Consider the situation like this... you type in this:
Syst

And then you press the Complete Word hotkey. You really want to intialize the member list with an offset of 0 and a length of 4 so that the whole piece is replaced.

Let me propose a couple things and get your response.

1) What if we add another Show method overload that takes a bool parameter. The parameter would indicate that if there is only one item in the list that is selected by the text in that offset range, it should not show the list and just go to complete it. The only problem I see is that it would no longer raise an event to indicate that the complete occurred.

2) The other idea would be to add something like a CompleteWord method that would accept an offset and length parameter. If it completed it could return true, otherwise it would call the Show method with the offset/length parameters and would return false.

After looking at both, I like option 2 a little better.


Actipro Software Support

Posted 19 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
Option 2 sounds perfect! I realize now why the 'Complete' method wouldn't do the trick without the 'Show' method being called first.
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Option 2 is now implemented for the next release.


Actipro Software Support

Posted 19 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
Sweet... looking forward to it.
The latest build of this product (v24.1.0) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.