Re: [Ctags] Problems with Objective C support for ctags?
Brought to you by:
dhiebert
From: Andrew R. <an...@ae...> - 2009-03-07 07:54:54
|
I posted patches a while ago for ctags obj-c support. It isn't perfect but it does a pretty decent job. There is one bug that someone has pointed out to me with functions that use prototypes in their arguments; i.e. something like this void copy_object(id <NSCopying>object); doesn't get parsed correctly, but other than that it picks up all the objective-c methods, classes, prototypes, etc.. I haven't gotten around to fixing that yet... If you have access to git, you can clone it with: git clone git://git.aeruder.net/ctags-objc.git Otherwise you can get a tarball from: http://gitweb.aeruder.net/?p=ctags-objc.git;a=snapshot;h=HEAD;sf=tgz - Andy On Fri, Mar 6, 2009 at 10:14 PM, Steven Arnold <st...@ar...> wrote: > It seems like it's quite an undertaking to support a new language, not > a mere matter of putting together a list of regexes....from browsing > the source, it seems someone went to great lengths to set up each > language. Is there a how-to guide or any documentation on how this > process can be done for a new language? > > Also, I am so-so with C but for example I can probably parse an > Objective-C file using Ruby or Python and emit a validly-formatted > file. How hard do you think this would be to integrate with the ctags > project? I guess we'd need a hook that reached out to other programs > to parse certain file extensions? It would be a natural way to > introduce a plugin architecture to ctags. > > steven > > > On Mar 6, 2009, at 11:15 PM, Elliott Hughes wrote: > >> objective c is not supported. >> >> --elliott >> >> On Fri, March 6, 2009 19:54, Steven D.Arnold wrote: >>> I do not think this was mailed properly last time, so if you are >>> seeing this twice, my apologies. >>> >>> I have newly installed ctags 5.7 from source, but it does not seem to >>> parse my Objective-C files. Does anyone know why I would get these >>> results? It does seem to parse, e.g., Java files just fine. >>> Here's a >>> simple ObjC file: >>> >>> #import "TDListCell.h" >>> >>> >>> static UIImage *starImage = nil; @implementation TDListCell >>> @synthesize title, blurb, permanent; >>> - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString >>> *)reuseIdentifier { >>> [etc] >>> return self; } >>> >>> >>> - (void)layoutSubviews { >>> CGRect bounds = [self bounds]; >>> [etc] >>> } >>> >>> >>> >>> - (void)setSelected:(BOOL)selected animated:(BOOL)animated { >>> [super setSelected:selected animated:animated]; >>> } >>> >>> >>> >>> - (void)dealloc { >>> [super dealloc]; >>> } >>> >>> >>> @end >>> >>> >>> The tags file from ctags is this: >>> >>> >>> [ 08:09 PM (7) omega:thoth ~/Source/learning/iPhone/BNR/ >>> PictureSlider/ >>> Classes ] > ctags PictureSliderAppDelegate.m >>> [ 08:09 PM (8) omega:thoth ~/Source/learning/iPhone/BNR/ >>> PictureSlider/ >>> Classes ] > cat tags >>> !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" >>> to >>> lines/ !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ >>> !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhi...@us.../ >>> !_TAG_PROGRAM_NAME Exuberant Ctags // >>> !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ >>> !_TAG_PROGRAM_VERSION 5.7 // >>> >>> >>> My editor of choice, jEdit, can't make anything useful from this. >>> >>> >>> I suspect I am missing something simple in my usage of ctags. I >>> understand it is supposed to support Objective C. What am I missing? >>> >>> Thanks, >>> steven >>> >>> >>> >>> ------------------------------------------------------------------------- >>> ----- >>> Open Source Business Conference (OSBC), March 24-25, 2009, San >>> Francisco, >>> CA >>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>> Enterprise >>> -Strategies to boost innovation and cut costs with open source >>> participation -Receive a $600 discount off the registration fee >>> with the >>> source code: SFAD http://p.sf.net/sfu/XcvMzF8H >>> _______________________________________________ >>> Ctags-users mailing list >>> Cta...@li... >>> https://lists.sourceforge.net/lists/listinfo/ctags-users >>> >>> >> >> >> -- >> Elliott Hughes, http://www.jessies.org/~enh/ >> >> >> >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San >> Francisco, CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source >> code: SFAD >> http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> Ctags-users mailing list >> Cta...@li... >> https://lists.sourceforge.net/lists/listinfo/ctags-users > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Ctags-users mailing list > Cta...@li... > https://lists.sourceforge.net/lists/listinfo/ctags-users > -- Andrew Ruder <an...@ae...> http://www.aeruder.net |