Hello
I am trying to get bracket highlighting for my SQL editor working for both normal braces and [ ] square braces.
The problem that I have is the following:
select * from [dbo].[mytable] - now if i place the cursor before the first, before the third or after the fourth token, it works as expected. However, if i place the cursor after the second bracket then it highlights the second bracket, but not the first as i would expect.
Here are some sections from my syntax language (largely based on the SQL example)
Hope that's enough info! Thanks in advance.
I am trying to get bracket highlighting for my SQL editor working for both normal braces and [ ] square braces.
The problem that I have is the following:
select * from [dbo].[mytable] - now if i place the cursor before the first, before the third or after the fourth token, it works as expected. However, if i place the cursor after the second bracket then it highlights the second bracket, but not the first as i would expect.
Here are some sections from my syntax language (largely based on the SQL example)
<!-- States -->
<States>
<!-- Code -->
<State Key="DefaultState">
<!-- Patterns Groups -->
<PatternGroups>
<!-- Whitespace -->
<RegexPatternGroup TokenKey="WhitespaceToken" PatternValue="{WhitespaceMacro}+" IsWhitespace="True" />
<!-- Line Terminators -->
<RegexPatternGroup TokenKey="LineTerminatorToken" PatternValue="{LineTerminatorMacro}" IsWhitespace="True" />
<!-- Brackets -->
<ExplicitPatternGroup Key="OpenParenthesisPatternGroup" TokenKey="OpenParenthesisToken" PatternValue="(" EndBracket="CloseParenthesisPatternGroup" />
<ExplicitPatternGroup Key="CloseParenthesisPatternGroup" TokenKey="CloseParenthesisToken" PatternValue=")" StartBracket="OpenParenthesisPatternGroup" />
<!-- Square bracket highlighting -->
<ExplicitPatternGroup Key="OpenSQParenthesisPatternGroup" TokenKey="DefaultToken" PatternValue="[" EndBracket="CloseSQParenthesisPatternGroup" />
<ExplicitPatternGroup Key="CloseSQParenthesisPatternGroup" TokenKey="DefaultToken" PatternValue="]" StartBracket="OpenSQParenthesisPatternGroup" />
<!-- Square Identifiers -->
<State Key="IdentifierState" TokenKey="IdentifierToken">
<!-- Scopes -->
<Scopes>
<Scope>
<ExplicitPatternGroup Key="OpenSQParenthesisPatternGroup" Type="StartScope" TokenKey="DefaultToken" PatternValue="[" EndBracket="CloseSQParenthesisPatternGroup" />
<ExplicitPatternGroup Key="CloseSQParenthesisPatternGroup" Type="EndScope" TokenKey="DefaultToken" PatternValue="]" StartBracket="OpenSQParenthesisPatternGroup" />
</Scope>
</Scopes>
<!-- Patterns Groups -->
<PatternGroups>
<!-- Square bracket highlighting -->
<ExplicitPatternGroup Key="OpenSQParenthesisPatternGroup" TokenKey="DefaultToken" PatternValue="[" EndBracket="CloseSQParenthesisPatternGroup" />
<ExplicitPatternGroup Key="CloseSQParenthesisPatternGroup" TokenKey="DefaultToken" PatternValue="]" StartBracket="OpenSQParenthesisPatternGroup" />