I can't for the life of me figure out why this isn't working in my language file, can someone help?
Thanks,
Steven
Sample text to search: ----snip------ <cffunction name="isEmpty" returnType="boolean" access="private" hint="checks to see whether a field is empty"> <cfargument name="inputField" type="string" required="true" hint="the input"> <cfset retBool = true /> <cfif Len(Trim(arguments.inputField))> <cfset retBool = false /> </cfif> <cfreturn retBool /> </cffunction> -----snip-----
regex that works when using "find" inside TM:
<cffunction\sname=(["'])
bundle language text:
{ name = 'support.other'; contentName = 'entity.name.function'; begin = '(<cffunction\sname).(["''])'; end = '["'']'; },
Sorry if this is a duplicate... didn't see it come across yet so I'm resending... I can't for the life of me figure out why this isn't working in my language file, can someone help?
Thanks,
Steven
Sample text to search: ----snip------ <cffunction name="isEmpty" returnType="boolean" access="private" hint="checks to see whether a field is empty"> <cfargument name="inputField" type="string" required="true" hint="the input"> <cfset retBool = true /> <cfif Len(Trim(arguments.inputField))> <cfset retBool = false /> </cfif> <cfreturn retBool /> </cffunction> -----snip-----
regex that works when using "find" inside TM:
<cffunction\sname=(["'])
bundle language text:
{ name = 'support.other'; contentName = 'entity.name.function'; begin = '(<cffunction\sname).(["''])'; end = '["'']'; },
<cffunction name="isEmpty" ...
regex that works when using "find" inside TM: <cffunction\sname=(["'])
bundle language text: { name = 'support.other'; contentName = 'entity.name.function'; begin = '(<cffunction\sname).(["''])'; end = '["'']'; },
If all you want to do is scope the name of the cffunction, I'd say you want to use a match/captures block, and leave the cffunction coloring consistent with the other cftags.
{ match = 'cffunction name="(\w+)"'; captures = { 1 = { name = 'entity.name.function'; }; }; }
It might be a bit much, but in theory it would work.
HTH, Daniel
Hmm for some reason this doesn't work either... strange.
On Fri, Mar 7, 2008 at 12:44 PM, Daniel Stockman daniel.stockman@gmail.com wrote:
<cffunction name="isEmpty" ...
regex that works when using "find" inside TM: <cffunction\sname=(["'])
bundle language text: { name = 'support.other'; contentName = 'entity.name.function'; begin = '(<cffunction\sname).(["''])'; end = '["'']'; },
If all you want to do is scope the name of the cffunction, I'd say you want to use a match/captures block, and leave the cffunction coloring consistent with the other cftags.
{ match = 'cffunction name="(\w+)"'; captures = { 1 = { name = 'entity.name.function'; }; }; }
It might be a bit much, but in theory it would work.
HTH, Daniel
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 8 Mar 2008, at 00:27, Steven Ross wrote:
Hmm for some reason this doesn't work either... strange.
Are you aware of the single-line matching limitation of language grammars?
So if ‘cffunction’ and ‘name’ are not on the same lines, you cannot match it with just a single rule.
What you can do is something like:
{ begin = '<cffunction'; end = '>'; patterns = ( { match = 'name=(["''])(.*?)\1'; captures = { 2 = { name = 'entity.name.function'; }; }; } ); },
ah, that would explain it... thanks, that will get me moving in the right direction
On Sun, Mar 9, 2008 at 5:35 AM, Allan Odgaard throw-away-2@macromates.com wrote:
On 8 Mar 2008, at 00:27, Steven Ross wrote:
Hmm for some reason this doesn't work either... strange.
Are you aware of the single-line matching limitation of language grammars?
So if 'cffunction' and 'name' are not on the same lines, you cannot match it with just a single rule.
What you can do is something like:
{ begin = '<cffunction'; end = '>'; patterns = ( { match = 'name=(["''])(.*?)\1'; captures = { 2 = { name = 'entity.name.function'; }; }; } ); },
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate