
Hi guys,
I'm still very new to the way you have built the highlighters in SyntaxEditor for WPF, so bear with me here :). I have the following in my HTML highlighter, which should be the proper way to make the language transition to JScript:This works just fine, but in trying to add outlining to my application, I'm experiencing a problem where, once a </script> tag is reached, the Lexer property of the IMergableToken is null, and even worse: When I try to test it for a null value, SyntaxEditor is apparently throwing a NullReferenceException:
The Id property of the token has the exact same behavior. How do I avoid this? The token looks fine otherwise, with its key set to EndTagStartDelimiter and everything. Have I done something wrong? :)
I'm still very new to the way you have built the highlighters in SyntaxEditor for WPF, so bear with me here :). I have the following in my HTML highlighter, which should be the proper way to make the language transition to JScript:
<State Id="15" Key="JScriptStartTag" DefaultTokenId="33" DefaultTokenKey="JScriptStartTagDefault" DefaultClassificationTypeKey="TagName">
<State.Scopes>
<Scope>
<Scope.StartPatternGroup>
<ExplicitPatternGroup TokenId="5" TokenKey="StartTagStart" ClassificationTypeKey="TagDelimiter" Pattern="<" LookAheadPattern="script" />
</Scope.StartPatternGroup>
<Scope.EndPatternGroup>
<RegexPatternGroup TokenId="6" TokenKey="StartTagEnd" ClassificationTypeKey="TagDelimiter" Pattern="/? >" />
</Scope.EndPatternGroup>
<Scope.Transition>
<StateTransition>
<StateTransition.ChildLanguage>
<LanguageRef FilePath="C:\long path\JScript.langdef" />
</StateTransition.ChildLanguage>
<StateTransition.ChildScope>
<Scope>
<Scope.EndPatternGroup>
<ExplicitPatternGroup TokenKey="EndTagStartDelimiter" ClassificationTypeKey="TagDelimiter" Pattern="</" LookAheadPattern="script" />
</Scope.EndPatternGroup>
</Scope>
</StateTransition.ChildScope>
</StateTransition>
</Scope.Transition>
</Scope>
</State.Scopes>
<State.ChildStates>
<StateRef Key="StartTagAttribute" />
</State.ChildStates>
</State>
System.NullReferenceException occurred
Message=Object reference not set to an instance of an object.
Source=ActiproSoftware.Text.Net351
StackTrace:
at s.get_Lexer()
at ActiproSoftware.Text.Lexing.Implementation.MergableToken.get_Lexer()
at TSW.WebCoder.Classes.Html.HtmlOutliningSource.GetNodeActionForToken(IToken token, IOutliningNodeDefinition& definition) in C:\long path\HtmlOutliningSource.cs:line 39
InnerException: