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
Le 12 juil. 06 à 05:04, Ryan Wilcox a écrit :
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.
fine, thanxs for your script !
by the way, i'm in order to add a C extension to Ruby (the skeleton of my C class has been tested and also i do have an ObjC working version).
then i want to add a Carbon function to my c file :
CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)alias_path, kCFURLPOSIXPathStyle, NO);
and for that purpose added :
#import <Foundation/Foundation.h> #import <CoreServices/CoreServices.h>
in my headers file, then i got numerous of errors, if i add only :
include "/Developer/Headers/FlatCarbon/CFURL.h" i get this error :
In file included from /System/Library/Frameworks/ CoreServices.framework/Frameworks/OSServices.framework/Headers/ OSServices.h:45, from /System/Library/Frameworks/ CoreServices.framework/Headers/CoreServices.h:25, from /Developer/Headers/FlatCarbon/CFURL.h:1, from RAliasFile.c:7: /System/Library/Frameworks/CoreServices.framework/Frameworks/ OSServices.framework/Headers/OpenTransport.h:723: error: parse error before numeric constant
i think their is one translation to di before using those headers ???
Yvon