Hi,
Just wondering how I go about altering the setup to have folding block comments in a PHP file? I only need to fold doc-block type comments which I see have been designated as effectively ^/**$ - I'm not worried about blocks within functions. My doc comments can be quite voluminous, and it's frustrating seeing huge swathes of comments and little class xxxx {... stubs when I want to get an over view of the entire file...
;-)
R
Hi,
Not sure about the etiquette on follow-ups to unanswered questions, but I've tried looking at the grammar, and noticed that
foldingStartMarker = '(/*|{\s*$|<<<HTML)'; foldingStopMarker = '(*/|^\s*}|^HTML;)';
already include standard comments, that don't seem to fold anyway! So adding
foldingStartMarker = '(/*|/**|{\s*$|<<<HTML)';
isn't going to make much difference.
I assume that there's some other interaction further down the grammar that's stopping even /* ... */ working as fold markers. I've tried removing bits an pieces, and can't get it to go. Any ideas anyone?
On 21 May 2007, at 09:41, Richard Dyce wrote:
Hi,
Just wondering how I go about altering the setup to have folding block comments in a PHP file? I only need to fold doc-block type comments which I see have been designated as effectively ^/**$ - I'm not worried about blocks within functions. My doc comments can be quite voluminous, and it's frustrating seeing huge swathes of comments and little class xxxx {... stubs when I want to get an over view of the entire file...
;-)
R
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 May 23, 2007, at 2:25 AM, Richard Dyce wrote:
Not sure about the etiquette on follow-ups to unanswered questions, but I've tried looking at the grammar, and noticed that
Was hoping that someone more familiar to PHP would answer, but reading your response there are a few things to note.
Your looking in the wrong grammar, PHP technically works when selected directly but your meant to use the HTML grammar when editing PHP. Hence it is the HTML foldings that are active not PHP. (Embedded grammars don't bring along their foldings, only the patterns.)
If you directly select PHP the comments will fold (provided the indention is the same), they are not part of the HTML foldings though, so you'd have to add them there.
Ah ha! (One forehead slap later!) Thanks Michael!
FWIW the following alterations to the HTML language seems to do the trick, with (as yet) no perceived fallout....
foldingStartMarker = '(?x) (<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset| style|script|ul|ol|form|dl)\b.*?> |<!--(?!.*--\s*>) |^<!--\ \#tminclude\ (?>.*?-->)$ |{{?(if|foreach|capture|literal|foreach|php|section|strip) |{\s*($|?>\s*$|//|/*(.**/\s*$|(?!.*?*/))) |^\s*/**$ # added for folding docblocks )'; foldingStopMarker = '(?x) (</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset| style|script|ul|ol|form|dl)> |^(?!.*?<!--).*?--\s*> |^<!--\ end\ tminclude\ -->$ |{{?/(if|foreach|capture|literal|foreach|php|section|strip) |^[^{]*} |^\s**/$ # added for folding docblocks )';
Thanks.
R