Re: IntelliPrompt Member List

SyntaxEditor for Windows Forms Forum

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Joe,

Sorry I'm not exactly following you. The IDs for various words are for keywords so tokens can be identified easier. However in your case, Address, etc. would be plain Identifiers. You'd have to do some token scanning to build the list of identifiers before the caret, examine the text of each identifier, and then show your member list data based on if it was Address or Country, etc.

The member list items don't care about ID values. IntelliPromptMemberListItem just takes the text to show and optional image indices.

Hope that helps, have a good weekend.


Actipro Software Support

Comments (2)

Posted 9 years ago by Joe
Avatar
Hi!

Quote:
The member list items don't care about ID values. IntelliPromptMemberListItem just takes the text to show and optional image indices.


But from where do I know what's the text and the image index is?

Up to now I make a information retrieval for each word like this:

else if (stream.Token.ID == SimpleTokenID.Order)
{  
    for (int index = SimpleTokenID.OrderStart + 1; index < SimpleTokenID.OrderEnd; index++)
    {
        memberListItemHashtable[SimpleTokenID.GetTokenKey(index).ToString()] = 

        new IntelliPromptMemberListItem(SimpleTokenID.GetTokenKey(index).ToString(), -1);

    }
}
But I can't imagine this is the right solution.
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Joe,

You can store data however you want. Each language and its requirements are different, so it's up to you to decide how to store the data you will populate the member list with. If you have hundreds of words that will be showing up in IntelliPrompt, I'm not sure that making each one a token is the best solution for you. As I said in my last reply, you probably want a majority of those to just map right to Identifier.

For instance in our .NET Languages Add-on, we keep an internal hierarchy tree of all known .NET Types based on the referenced assemblies you load in our DotNetProjectResolver. When we build member lists that include Types, we scan through that hierarchy and add items that apply from that.

I assume when you get the notification to show a member list, you are creating a TextStream (from Document.GetTextStream) and are scanning through tokens there to determine what to show. You can look at TokenText, etc. right from the TextStream. That's more or less what we do, we look at the tokens and decide what to show. The data of what to show comes from the data that we store elsewhere, such as in that Type hierarchy data structure I mentioned that we use internally in our add-on.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 6 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.