[TxMt] Smarter Cocoa Completion Command

Joachim Mårtensson joachimm at etek.chalmers.se
Wed Jan 17 20:38:20 UTC 2007


Hello everybody.
I added some functionality to my cocoa-completion command. It will now
show context based completion suggestions when the type of the reciever
can be deduced. If it can not find a method based on class, then it will
revert back to the old behaviour giving you all possible candidates. The
command currently only gives context sensitive information for AppKit and
Foundation.

Here are the two cases that give context-sensitive suggestions: (^ is the
caret) hit alt-Esc as usual.

[NSString someClassMethod^]
[[object pathWithComponents:myArray]
instanceAndClassMethodsThatWorksOnAString^]

Due to a bug (that crashes TextMate) that I have not managed to track down
I have restricted the functionality, so that one always have to type
atleast one char before completions are available.

The command uses methods from rubycocoa
(http://rubycocoa.sourceforge.net/), so be certain to have that installed
and that it can be reached from the standard ruby interpreter (or change
the she-bang line in the command).

If you like this version of the completion command, then please tell me
and I will switch the one in svn to this.

Joachim Mårtensson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Cocoa Context.tmCommand.gz
Type: application/x-gzip
Size: 2658 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20070117/82098a3e/attachment.gz>


More information about the textmate mailing list