[TxMt] Objective-C Bundle

Craig Rose craig.rose.dev at gmail.com
Sun Jan 6 01:58:16 UTC 2008


Hi Joachim and TextMate peoples

I've had a look at the WIP Objective-C and C bundles and firstly a question:

- Why does the Singleton template create an Objective-C++ implementation
file - file extension is .mm? Also it might be preferable to use Apple's
"recommended" singleton implementation:
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/chapter_3_section_10.html#//apple_ref/doc/uid/TP40002974-CH4-SW32

- The help is a lot better without the side frame.

These next points are just stuff I've noticed in the current Objective-C
bundle:

- Underscores in implementation and interface files aren't supported. (eg.
"@interface TestCoreData_AppDelegate : NSObject" - "AppDelegate" will not be
highlighted).

- "Reformat Method Call" is a really good tool for keeping code tidy, but
there are some problems with indenting that makes it less worthwhile.
An example is the following code call (imagine I've just hit control-Q to
reformat and the NSWindow call is all nice an indented)

isHidden = YES;
mainWindow = [[NSWindow alloc] initWithContentRect:windowRect

styleMask:NSTitledWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask
                                           backing:NSBackingStoreBuffered
                                             defer:NO
                                            screen:[NSScreen
mainScreen]];<caret>


1. Pressing enter/return on the last line will continue on the next line
directly under "screen:..." - this is fine and expected.
2. Getting back to normal indent (aligned with "mainWindow" and "isHidden")
requires pressing backspace 11 times. Note that if you hit tab at anytime
you will be catapulted under "screen:" and have to start again.

Is there anyway around this in the syntax file or would this require changes
to how TextMate auto-indents?

-

I do feel a little guilty making these assessments because some of this
stuff I imagine would be trivial to update. If I were to create some
patches, what is the protocol for getting them to people for review? Can I
just email, or should I post them to this mailing list first?

Thanks
Craig

On Jan 5, 2008 11:17 PM, Craig Rose <craig.rose.dev at gmail.com> wrote:

> Hi Joachim
>
> Thanks for replying and for your work on the Objective-C bundle. I was
> unaware that work was ongoing in the WIP bundle and I will try that out as
> soon as possible. Please forgive me if I've mentioned anything that the new
> bundle addresses.
>
> Thanks again,
> Craig
>
>
> On Jan 4, 2008 7:59 PM, Joachim Mårtensson <joachimm at etek.chalmers.se>
> wrote:
>
> > > Hi all
> > >
> > > I've been using the Objective-C bundle for about a year now for all my
> > > Cocoa
> > > coding. It has a lot of nice features, but there are few shortcomings
> > and
> > > I
> > > was wondering if anyone is actively working on this.
> > Yes, I am working on it (not so actively lately though, been busy) and
> > so
> > are a few others (Allan, Rob Rix, Ciaran Walsh to name a few). Nice to
> > hear that we are not the only ones using TextMate for Objective-C.
> > >
> > > A few things off the top of my head:
> > >
> > > - No completion of new classes in leopard (eg. NSGradient, Core
> > Animation
> > > classes) or any syntax highlighting for new Objective-C 2.0 features.
> > >
> > > - Cocoa classes are automatically highlighted (eg. declaring a
> > variable as
> > > NSRect will show "NSRect" highlighted). Other Apple classes like those
> > in
> > > CoreGraphics should also get the same treatment. Declaring a variable
> > as a
> > > CGRect won't show "CGRect" highlighted. Also help doesn't work for
> > these
> > > items.
> > The classes and types that are highlighted, were generated way back, by
> > a
> > script written by Allan(Support/Collect Cocoa Definitions.sh). With the
> > exception of the addition of Notifications to the list of
> > highlighted/scoped constants, not much has happend to this part of the
> > grammar. If you try out the WIP C bundle, the scope
> > "variable.other.dot-access.c" will match the new Objective-C 2.0
> > properties syntax, ofcourse it will also match standard C struct access.
> > If you try out the WIP C bundle a good companion is the WIP Objective-C
> > bundle, it will provide somewhat stronger code completion features.
> >
> > It is clearly time to update the list both for completions and scoping
> > though.
> > >
> > > - "Completion: Partial Method Signature" is really handy for inserting
> >
> > > delegate method signatures. It does however insert different spacing
> > then
> > > the "Interface/Class Method" snippet.
> > > For example in an interface file:
> > >  Typing "-awakeFromN<tab>" will insert "-(void)awakeFromNib;"
> > > Typing "m<tab>" will insert "- (id)method:(id)anArgument;" (notice the
> > > extra
> > > space after the "-")
> > For some reason I have not noticed this. I will fix it the next time my
> > mac gets internet access.
> >
> > Joachim Mårtensson
> >
> >
> > ______________________________________________________________________
> > For new threads USE THIS: textmate at lists.macromates.com
> > (threading gets destroyed and the universe will collapse if you don't)
> > http://lists.macromates.com/mailman/listinfo/textmate
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20080106/9ec27c8e/attachment.html>


More information about the textmate mailing list