PBXtra

Links and Downloads

PBXtra.tgz

Enjoy PBXtra?

Problem:
I don't have the Cocoa API memorized.
Solution:
Flashcards.
Better Solution:
Use the source code indexer to give me some hints...

1. What It Does

The PBXtra.bundle adds some some simple symbol searching / completion capabilities to Project Builder for Objective-C. It does this by creating an NSTextView category (PBXtra) and adding a new method called PBXtra_listMatchingSymbols:.

It should be stressed that this is just a thin wrapper around the Project Builder indexing engine and that I haven't written any amazing code to parse Objective-C source code.

2. Installing

You may have to create these directories if they don't exist already.

Note: You can also use the ~/Developer/ProjectBuilder Extras/Plug-ins/ directory, which will only load this plugin when you are logged in. Thanks go to Armin Briegel for pointing this out.

3. How To

Once you've installed the files, start Project Builder. Open a project and make sure you have done a Build at least once. Project Builder indexes source code when you build a project, so until you do that, there won't be any symbols to find.

After that, you should be able to see its functionality quite easily.

Type in something like:

[nsstr

and hit Option-M.

You should see something along the lines of the image below:

At this point, hitting Option-M again will complete as much as possible - meaning the longest common prefix - and allow you to keep browsing the symbols. So in this example, nsstr would become NSString in the selection, and the popup would stay around.

Return, enter and tab will all insert the full text of the selection in to the text selection.

4. Caveats

  1. The "algorithm" (if it can be called that) that determines the current context for filtering symbol types is not what I would call robust. It seems to work in my testing, but I've no doubt some difficult cases could trip it up.
  2. This entire thing is based on private non-final APIs inside Project Builder. It works on the latest (August 2002) version of Project Builder - I doubt it works on earlier versions and I could very well break on the next release.
  3. No hints about which receivers respond to which messages are readily available. This is not an easy problem to solve since Objective-C is so heavily dependent on runtime rather than compile time typing.
  4. Source code is not pretty - I rushed and it shows. I'll still post it. Maybe sourceforge. Probably just a tarball on my site. Contact me if you are in a rush to look at it.

5. Questions | Comments | Feedback

Please feel free to contact me via email - I'm interested to hear your criticisms and thoughts. Honestly, since this is based on such a shady foundation (private API's and the like) I'm not going to devote a huge amount of time to this, but I will likely patch up the major annoyances.

6. Thanks

Mike Ferris - TextExtras souce was a good reference and a few extra hints via email had me well on my way.

7. Revision History

v0.3 - released 2002-10-15

v0.2 - released 2002-10-07

v0.1.1 - released 2002-10-06

v0.1 - released 2002-10-05