LexicalState.Tag loosing value

SyntaxEditor for Windows Forms Forum

Posted 16 years ago by Markus Hildebold
Version: 4.0.0275
Avatar
LexicalState.Tag Problem

I'm attempting to create a very simple langauage based heavily on your SqlDynamicSyntaxLanguage example and have some newbie questions.

After selcting a Item in the IntelliPromptMemberList, I want to store the data about the item in the Token.LexicalState.Tag. I do this at the OnSyntaxEditorIntelliPromptMemberListClosed event.
Looking at the results in debug mode I can see that my data is stored in the LexicalState.Tag. But later when I call Document.Tokens evry Token.LexicalState.Tag in the collection has the Value 1(int)??
Is this the wrong way to use LexicalState?

Thanks,
Markus Hildebold

Comments (2)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Markus,

The LexicalState will be shared among many tokens. So that is not a good place to store info if you want to keep custom info for a particular token.

DynamicToken has a SemanticParseData property you could use if you need to store data. You would probably need to cast your IToken to that type as long as you are using a dynamic language.


Actipro Software Support

Posted 16 years ago by Markus Hildebold
Avatar
Thanks, now it works fine.
The latest build of this product (v24.1.0) 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.