TextMate Now Has Cocoa Completions
There's a lot to like about TextMate build 1310. There's the Halloween-themed icon, for example, as well as the spider web content background. But the real news is that the Objective-C bundle now autocompletes built-in Cocoa methods, addressing one of the few obvious advantages Xcode's editor had over TextMate.In typical fashion, this feature was added to the main Objective-C bundle without much fanfare, but here's the item from the release notes:
Objective-C bundle: A partially typed (system) method call can now be completed by pressing ^M, if there are multiple candidates, a menu is shown. The insertion is a snippet so you can tab between the argument placeholders (Joachim Martensson)
There are some scripts in the bundle that go out and index the methods in key frameworks like AppKit, Foundation, Core Data, Core Image, and so. You can almost certainly index more frameworks by adding a few lines to the scripts.
The one advantage Xcode still has here, though, is context-sensitive completions. That is, it will present the completions that apply to type of object you're calling the method on. Whether that matters to you against the backdrop of all the other tools that TextMate offers to Cocoa developers is a personal choice.
You activate the completions by pressing Control-M. If there are multiple completions, a menu appears. You can select an item by mouse, numeric key, arrows keys, or even type-to-select:
The Control-M is actually pretty awkward, unless you're used to using your right-hand pinky finger to press the control key. I might try to get used to it, but another option is to just change the key equivalent in the Bundle Editor:
This is separate from the short list of "Cocoa Completions," which is also in the Objective-C bundle. That contains a small batch of the most common class names and methods, activated with the normal Esc-based autocomplete. You can add to this list yourself, again using the Bundle Editor:
The previous build, 1305, added the ability to get TextMate to display custom nib files as if they were native. It's easier to watch the screencast. Daring Fireball has some nice things, to say about this.
To get automatic notifications for these builds, go to Preferences > Software Update > Watch For: "Cutting-Edge". These builds tend to be just as usable as the official releases.
TextMate Now Has Cocoa Completions
Posted Oct 31, 2006 — 15 comments below
Posted Oct 31, 2006 — 15 comments below
Jacob Rus — Oct 31, 06 2254
Jacob Rus — Oct 31, 06 2255
Scott Stevenson — Oct 31, 06 2256
Done!
Dan Price — Oct 31, 06 2257
Dan Price — Oct 31, 06 2258
XCode still isn't as nice as say, Visual Studio, and looks rather old-fashioned by comparison. I'm hoping the new version in 10.5 will be recitfy this (code expansion etc).
Scott Stevenson — Oct 31, 06 2259
I use Xcode as a data modeler and as a front end to gcc/gdb. I use TextMate for practically everything else.
Dan Price — Oct 31, 06 2260
I'm not a power-coder. I don't think I would have the patience to copy and paste code back and forth from a text editor and XCode simply for the sake of better text-handling. It's the sort of thing I used to do back in the LightSpeed Pascal days; I don't expect to do it in 2006 :P
Alastair Tse — Oct 31, 06 2261
You don't copy text back and forth, you just not use the Xcode editor for editing text files. That is, you just have TextMate and Xcode open.
On a related note, I once knew a programmer who didn't know how to use vi so she wrote C++ programs in Microsoft Word and cut and pasted them into a terminal. I don't know how long she kept her job for.
Scott Stevenson — Oct 31, 06 2268
Neither do I.
To expand on what Alastair said, Xcode has a feature called "external editor support," meaning you double-click on a file in Xcode and it opens in your editor. You also just drag the whole group of files to the TextMate icon.
TextMate also has a front end to the Xcode build system, so you just hit command-B and watch the process go. I haven't found a way to do debugging with it, though.
Also "better text handling" is quite the understatement. There's a reason it won best developer tool at WWDC. :)
Bill Coleman — Nov 02, 06 2275
Gack! I still can't believe he said that!
I use VS 2005 every day. It's a toy compared to XCode. Sure, it looks like it has a lot of pretty features, but many things don't work correctly. Builds take forever, the Visual Designer is a joke, and many times a day I feel like just taking the whole machine and chucking it out the nearest window!
XCode, on the other hand, is a joy to use, appears to handle lots of complex code with aplumb, understands how to make effective use of multiple cores, and has never just gone out to lunch on me.
Tidbit: Microsoft does not use Visual Studio internally for development. Apple does use XCode. It shows.
Joachim Mrtensson — Nov 05, 06 2299
At least that way she would have complete control over the syntax coloring;).
I'm glad that you like the command. It seems like the menu option Allan Odgaard added to tm_dialog, has spured a lot of code completion related work, so it is likely that we will come up with a better key-combination for code-completion than ^M and one that is common to all language bundles
Panagiotis Atmatzidis — Nov 06, 06 2312
trolling mode on
If the machine runs Microsoft Windows, I guess the window is the right path!
trolling mode off
Panagiotis Atmatzidis — Nov 06, 06 2313
Tidbit: Microsoft does not use Visual Studio internally for development. Apple does use XCode. It shows.
Can you prove that? How do you know?
Johannes Huning — Dec 07, 07 5173
kind regards
Johannes Huning
Scott Stevenson — Dec 07, 07 5180
Yes. The key equivalent changed at some point.