Posted 20 years ago
by painetraine
I am trying to create a particular state that maps tp a SQL Server system stored procedure, ie. sp_<...>?
I have the following defined for a state,
<State Key="SystemProcState" Token="SystemProcDefaultToken" Style="FunctionStyle">
<Scopes>
<Scope>
<RegexPatternGroup Type="StartScope" Token="SystemProcStartToken" Style="FunctionStyle" PatternValue="[Ss][Pp][_]{1}\w*" LookAhead="{NonWordMacro}"/>
<RegexPatternGroup Type="EndScope" Token="SystemProcEndToken" Style="DefaultStyle" PatternValue="\w|\s"/>
</Scope>
</Scopes>
<PatternGroups>
<RegexPatternGroup Token="SystemProcDefaultToken" PatternValue="\s+" />
</PatternGroups>
</State>
However, when I try to use this state, if doesn't end until the 2nd non-space character, so for example,
sp_test 'user'
The above would format "sp_test '" as the system proc state and then user' as non-sysproctstae which causes issues because then the ' after user is treated as the start of a string.
How can I change my definition to work so that this will work and only highlight the sp_<...> name and not the space and next character afterewards?
Thanks in advamce
I have the following defined for a state,
<State Key="SystemProcState" Token="SystemProcDefaultToken" Style="FunctionStyle">
<Scopes>
<Scope>
<RegexPatternGroup Type="StartScope" Token="SystemProcStartToken" Style="FunctionStyle" PatternValue="[Ss][Pp][_]{1}\w*" LookAhead="{NonWordMacro}"/>
<RegexPatternGroup Type="EndScope" Token="SystemProcEndToken" Style="DefaultStyle" PatternValue="\w|\s"/>
</Scope>
</Scopes>
<PatternGroups>
<RegexPatternGroup Token="SystemProcDefaultToken" PatternValue="\s+" />
</PatternGroups>
</State>
However, when I try to use this state, if doesn't end until the 2nd non-space character, so for example,
sp_test 'user'
The above would format "sp_test '" as the system proc state and then user' as non-sysproctstae which causes issues because then the ' after user is treated as the start of a string.
How can I change my definition to work so that this will work and only highlight the sp_<...> name and not the space and next character afterewards?
Thanks in advamce