I have the following ASP.net code <tag attribute="<%# Users.PageSize %>" /> the scope of the #... part is coming up as comment.line.number- sign.ruby instead of source.asp.embedded.html I've tried messing with everything I can think of. I can't figure out how to keep it from defaulting to the ruby deal.
any suggestions would be lovely.
On 11/08/2005, at 23.19, thomas Aylott wrote:
I have the following ASP.net code
<tag attribute="<%# Users.PageSize %>" /> the scope of the #... part is coming up as comment.line.number- sign.ruby instead of source.asp.embedded.html
The reason is that ruby (or eruby rather) uses <% %> as delimiters also. There should be an ASP bundle with a language that can be used, I think?
-- Sune.
On Aug 11, 2005, at 5:27 PM, Sune Foldager wrote:
On 11/08/2005, at 23.19, thomas Aylott wrote:
I have the following ASP.net code
<tag attribute="<%# Users.PageSize %>" /> the scope of the #... part is coming up as comment.line.number- sign.ruby instead of source.asp.embedded.html
The reason is that ruby (or eruby rather) uses <% %> as delimiters also. There should be an ASP bundle with a language that can be used, I think?
Yep, i'm using the ASP bundle, but the ruby definition is overwriting the property on that item. I'm sure something just needs to be added to the ASP bundle to make it overwrite all others, but I can't figure it out.
On 11/08/2005, at 23.27, Sune Foldager wrote:
I have the following ASP.net code
<tag attribute="<%# Users.PageSize %>" /> the scope of the #... part is coming up as comment.line.number- sign.ruby instead of source.asp.embedded.html
The reason is that ruby (or eruby rather) uses <% %> as delimiters also. There should be an ASP bundle with a language that can be used, I think?
I assume he's already using that.
The problem is that TM uses the rule which gives the longest match. The HTML grammar has a specific rule for the <%#...%> case (since the Ruby syntax doesn't know about erb and would include %> in the comment).
This rule will always be a longer match than the begin = "<%" in the ASP grammar (since for begin/end rules, the length of the begin pattern is used), thus the Ruby comment rule (in the HTML grammar) will win over the embedded ASP rule, in the ASP grammar which includes the HTML grammar.
This is one of the reasons why I recently proposed to change the system to always use the first rule which matches, rather than the longest :)
For now I'd suggest just removing the Ruby comment rule from the HTML grammar, and hopefully soon I'll change the precedence algorithm (I need to check and possibly re-arrange all grammars when doing so).