A month or two ago I started making a Coldfusion bundle and haven't look at it since... and now I'm back doing some CF work again the highlighting is starting to piss me off, so I thought I'd ask you guys: how do I do a bundle pattern that matches nested comments?
In CFML you can have
<!--- <cfif something eq true> <!--- A nested comment ---> </cfif> --->
and the whole thing should be syntax coloured as a comment.
The basic pattern at the moment is:
{ name = 'comment.block.html'; begin = '<!---'; end = '--->'; }
any ideas how to get nesting working?
-- Tim
any ideas how to get nesting working?
Put the comment pattern in the repository then include it in the main syntax that way. Then you add the comment repository item to the comment item itself:
repository = { comment = { name = 'comment.block.html'; begin = '<!---'; end = '--->'; patterns = ( { include = '#comment'; }, ); }; };
On 11/02/2006, at 8:05 AM, Michael Sheets wrote:
any ideas how to get nesting working?
Put the comment pattern in the repository then include it in the main syntax that way. Then you add the comment repository item to the comment item itself.
Thanks Michael, worked a treat.
One question though: how do use the repository item in the main syntax, rather than repeating the pattern def again.
I've tried various combinations, but could only get this to work:
patterns = ( { name = 'comment.block.html'; begin = '<!---'; end = '--->'; patterns = ( { include = '#comment'; } ); }, ... );
repository = { comment = { name = 'comment.block.html'; begin = '<!---'; end = '--->'; }; };
-- tim
On 15/2/2006, at 5:48, Tim Lucas wrote:
One question though: how do use the repository item in the main syntax, rather than repeating the pattern def again.
Just do: include = "#«rule_name»"; and it includes the rule in the main syntax.
I've tried various combinations, but could only get this to work: [...]
Try this:
patterns = ( { include = '#comment'; }, ... ); repository = { comment = { name = 'comment.block.html'; begin = '<!---'; end = '--->'; patterns = ( { include = '#comment'; } ); }; };
Tim Lucas <t.lucas@...> writes:
A month or two ago I started making a Coldfusion bundle and haven't look at it since... and now I'm back doing some CF work again the highlighting is starting to piss me off, so I thought I'd ask you guys: how do I do a bundle pattern that matches nested comments?
In CFML you can have
<!--- <cfif something eq true> <!--- A nested comment --->
</cfif> --->
and the whole thing should be syntax coloured as a comment.
The basic pattern at the moment is:
{ name = 'comment.block.html'; begin = '<!---'; end = '--->'; }
any ideas how to get nesting working?
Tim, is your bundle available in any form at all? I'd be really interested in trying it out. I'm a ColdFusion developer and Dreamweaver doesn't impress me much on the Mac. I'd love to get more into TextMate, but without ANY support for ColdFusion....
Or it would even be a start to figure out how to make it treat CFM files as HTML (and stop all that squiggle underlining).
Thanks.
-- Clint