Hello all,
I'm starting to set up my environment to use TextMate instead of XCode's built in editor.
The one thing I miss from XCode is its Code Sense. I really like having a quick reference of the API command I want. I know I want, say, to use CFBundleCopyResourceURL(), but I don't remember what to feed it.
Since XCode doesn't provide a way to query for that information (thanks, Apple), I had to get it "another way". It seems that the easiest way to do that is to grep the framework header files myself.
My script takes the selected word, finds it in the 10.4u SDKs, then makes a txmt:// style URL out of it, so you can click the link and go right to the proper line in the proper header file.
The script is posted below. Hopefully it will be useful to you Carbon programmers out there, or maybe the kind Unix hands will see some optimization I can use to make it faster.
_______________________________
find -L /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/*/Versions/Current/* | xargs grep -I -n $TM_SELECTED_TEXT | python -c "import fileinput, re
ourRe = re.compile(r'(.+?):(.+?):(.+)') for each in fileinput.input(['-']): res = ourRe.match(each) if res: print '''<p><a href='txmt://open/?url=file://%s&line=%s'>%s</a></p>''' % ( res.group(1), res.group(2), res.group(3) )"
_______________________________
Enjoy all!, _Ryan Wilcox