
I don't seem to be able to get the GoToPreviousMatchingToken in the TextStream class to work for a dynamic language.
I have declared the following syntax in the language xml file (which seems to work as outlining is disaplyed in the editor around the brackets)
<ExplicitPatternGroup Key="OpenParenthesisPatternGroup" TokenKey="OpenParenthesisToken" PatternValue="(" EndBracket="CloseParenthesisPatternGroup" />
<ExplicitPatternGroup Key="CloseParenthesisPatternGroup" TokenKey="CloseParenthesisToken" PatternValue=")" StartBracket="OpenParenthesisPatternGroup" />
However when running my program and entering some text like Invalidate(a,b) in the Editor the following source code always returns false for the GoToPreviousMatchingToken:
TextStream stream = syntaxEditor.Document.GetTextStream(syntaxEditor.Caret.Offset);
IToken token = stream.ReadTokenReverse(); // token selected is the )
bool foundMatchingToken = stream.GoToPreviousMatchingToken(token);
The matching open bracket is not found.
Any suggestions would be appreciated?
Chris.
I have declared the following syntax in the language xml file (which seems to work as outlining is disaplyed in the editor around the brackets)
<ExplicitPatternGroup Key="OpenParenthesisPatternGroup" TokenKey="OpenParenthesisToken" PatternValue="(" EndBracket="CloseParenthesisPatternGroup" />
<ExplicitPatternGroup Key="CloseParenthesisPatternGroup" TokenKey="CloseParenthesisToken" PatternValue=")" StartBracket="OpenParenthesisPatternGroup" />
However when running my program and entering some text like Invalidate(a,b) in the Editor the following source code always returns false for the GoToPreviousMatchingToken:
TextStream stream = syntaxEditor.Document.GetTextStream(syntaxEditor.Caret.Offset);
IToken token = stream.ReadTokenReverse(); // token selected is the )
bool foundMatchingToken = stream.GoToPreviousMatchingToken(token);
The matching open bracket is not found.
Any suggestions would be appreciated?
Chris.