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.
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.
- "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 "-")
-
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
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@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@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
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/...
- 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@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@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@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
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/...
To the best of my knowledge I have made any changes to this, I do not personally use the templates. Perhaps someone else can reply?
- The help is a lot better without the side frame.
The help uses a standard template which I assume is used for all markdown docs, I guess it can be switched somehow.
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).
This seems like a regexp bug that should be easy to fix. Thanks for bringing it to my attention. Will fix asap.
- "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>
- 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 not think messing with the indent/dedent patterns are going to help. I actually had a conversation with Allan about this a few months ago since it annoys me as well, he had a few ideas for 2.0 if I recall correctly. A command to do this would involve both code and adding scopes to the syntax grammar (unless I am mistaken about the auto-indent behaviour).
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?
The bundle developers hang out in ##textmate (two #) IRC channel at freenode.net. Also check out the dev list. You are more than welcome to submit patches.
Joachim Mårtensson
On 7 Jan 2008, at 13:53, Joachim Mårtensson wrote:
[...]
- Why does the Singleton template create an Objective-C++
implementation file - file extension is .mm?
Because I always need C++ in my Objective-C code :)
Also it might be preferable to use Apple's "recommended" singleton implementation: http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/... /apple_ref/doc/uid/TP40002974-CH4-SW32
To the best of my knowledge I have made any changes to this, I do not personally use the templates. Perhaps someone else can reply?
I don’t think Apple had a recommended one when I did the template. I’ll look into updating it.
[...]
- "Reformat Method Call" is a really good tool for keeping code
tidy, but there are some problems with indenting [...]
I do not think messing with the indent/dedent patterns are going to help. I actually had a conversation with Allan about this a few months ago since it annoys me as well, he had a few ideas for 2.0 if I recall correctly. A command to do this would involve both code and adding scopes to the syntax grammar (unless I am mistaken about the auto-indent behaviour).
Yeah, too complex to solve for 1.x. Should be better in 2.0.