[TxMt] Method/function list?
kumar mcmillan
kmcmillan at leapfrogonline.com
Tue Nov 30 16:47:49 UTC 2004
On Nov 29, 2004, at 7:07 PM, Eric Hsu wrote:
>> I am hoping I¼m just missing something obvious... Is there some kind
>> of
>> list of functions/methods? I.e. Similar to BBEdit or SEE¼s popup
>> function
>> list?
>
> Here's my kludged version of it for Perl using TM commands, which pops
> up a separate window listing all the subroutines (i.e. lines that
> begin with 'sub ').
>
> Make a command:
>
> - before: Do Nothing
> - Command: grep -n "^sub "
> - Std In: Entire document
> - Std out: Show in separate win
> - Pattern: ^(\d+):(.*)$
> [this parses out the grep output so we can identify the line part]
> - Format: $2
> - Line:1
>
> This idea can be tweaked to fit the language of your choice. I think
> you can pipe it cleverly through sort to get the subroutines
> alphabetized.
wow! I love TM. Allan are you trying to make us into zealots?
I didn't really understand the Line / Format boxes in the command
dialog, thanks for posting this Eric. Here is a pattern for PHP files
:
grep -En "^[^\*/]*(abstract|public|private|function|class|interface)
[&a-zA-Z0-9_]+"
it's still not ideal, but between F1, up/down arrows and the Esc key,
hands don't have to leave the keyboard... great workaround.
-k
PS. is there documentation somewhere on how exactly "Format String",
"File Register", "Line", and "Column" work together?
>
> good luck, Eric
> --
> Eric Hsu, Assistant Professor of Mathematics
> San Francisco State University
> erichsu at math.sfsu.edu
> http://math.sfsu.edu/hsu
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/mailman/listinfo/textmate
More information about the textmate
mailing list