
If you assign some data to the SemanticParseData property of a DynamicToken object, it is removed sometime before the next parse takes place. To repro in the sample app, do the following:
-In the DocumentTextChanged event of the SDI sample app add the following code:-Launch the SDI sample app and select the c# dynamic language
-Go to the first comment of the sample and modify a comment word
-Modify the same comment word again, you should see the parse data "my parse data" in the output but it is null every time.
If getting/setting SemanticParseData works differently in 4.0 then just let me know how I can set and retrieve data from dynamic tokens via the SemanticParseData property. Thanks.
-In the DocumentTextChanged event of the SDI sample app add the following code:
TextStream ts = e.Document.GetTextStream(
Math.Max(e.Modification.InsertionEndOffset - 1, 0));
DynamicToken token = ts.Token as DynamicToken;
if (token == null) return;
if (token.Key == "CommentWordToken")
{
string parseData = token.SemanticParseData == null ?
"" : token.SemanticParseData.ToString();
this.WriteLine("Comment Changed, Parse Data: " +
parseData);
token.SemanticParseData = "my parse data";
}
-Go to the first comment of the sample and modify a comment word
-Modify the same comment word again, you should see the parse data "my parse data" in the output but it is null every time.
If getting/setting SemanticParseData works differently in 4.0 then just let me know how I can set and retrieve data from dynamic tokens via the SemanticParseData property. Thanks.
------------------------------- Marianne