diff --git a/extras/imported/objc-mode/.yas-ignore-filenames-as-triggers b/extras/imported/objc-mode/.yas-ignore-filenames-as-triggers new file mode 100644 index 0000000..e69de29 diff --git a/extras/imported/objc-mode/.yas-make-groups b/extras/imported/objc-mode/.yas-make-groups new file mode 100644 index 0000000..e69de29 diff --git a/extras/imported/objc-mode/.yas-setup.el b/extras/imported/objc-mode/.yas-setup.el new file mode 100644 index 0000000..289b345 --- /dev/null +++ b/extras/imported/objc-mode/.yas-setup.el @@ -0,0 +1,38 @@ +;;; conditions +(yas/define-condition-cache + yas/objc-interface-p + "Non-nil if point inside an objc @interface declaration." + (yas/objc-in-c-block-like "@interface")) + +(yas/define-condition-cache + yas/objc-implementation-p + "Non-nil if point inside an objc @implementation declaration." + (yas/objc-in-c-block-like "@implementation")) + +(yas/define-condition-cache + yas/objc-method-body-p + "Non-nil if point inside an objc @implementation declaration." + (yas/objc-in-c-block-like 'objc-method-intro)) + + +(defun yas/objc-in-c-block-like (symbol-or-regexp) + (let ((original-point (point)) + (start-point nil)) + (save-excursion + (cond ((symbolp symbol-or-regexp) + (c-beginning-of-defun) + (setq start-point (point)) + (let ((syntax-info (c-guess-basic-syntax))) + (when (and syntax-info + (eq (caar syntax-info) symbol-or-regexp)) + (c-end-of-defun) + (and (< start-point original-point) + (< original-point (point)))))) + ((stringp symbol-or-regexp) + (when (search-backward-regexp symbol-or-regexp + nil + t) + (setq start-point (point)) + (when (search-forward-regexp "^@end" nil t) + (and (< start-point original-point) + (< original-point (point)))))))))) diff --git a/extras/imported/objc-mode/Accessor Methods For/090 Object Accessors (objacc).yasnippet b/extras/imported/objc-mode/Accessor Methods For/090 Object Accessors (objacc).yasnippet new file mode 100644 index 0000000..5696d3e --- /dev/null +++ b/extras/imported/objc-mode/Accessor Methods For/090 Object Accessors (objacc).yasnippet @@ -0,0 +1,17 @@ +# -*- mode: snippet -*- +# key: objacc +# contributor: Translated from TextMate Snippet +# name: Object +## condition: "(source.objc | source.objc++) & meta.scope.implementation.objc - meta.function-with-body" +# -- +- (${1:id})${2:thing} +{ + return $2; +} + +- (void)set${2/./\u$0/}:($1)aValue +{ + $0${1/( \*)?$/(?1:$1: )/}old${2/./\u$0/} = $2; + $2 = [aValue retain]; + [old${2/./\u$0/} release]; +} \ No newline at end of file diff --git a/extras/imported/objc-mode/Accessor Methods For/CoreData Accessors Implementation.yasnippet b/extras/imported/objc-mode/Accessor Methods For/CoreData Accessors Implementation.yasnippet new file mode 100644 index 0000000..a110b66 --- /dev/null +++ b/extras/imported/objc-mode/Accessor Methods For/CoreData Accessors Implementation.yasnippet @@ -0,0 +1,20 @@ +# -*- mode: snippet -*- +# key: cdacc +# contributor: Translated from TextMate Snippet +# name: CoreData +## condition: "source.objc, source.objc++" +# -- +- (${1:id})${2:attribute} +{ + [self willAccessValueForKey:@"${2: attribute}"]; + ${1:id} value = [self primitiveValueForKey:@"${2: attribute}"]; + [self didAccessValueForKey:@"${2: attribute}"]; + return value; +} + +- (void)set${2/./\u$0/}:($1)aValue +{ + [self willChangeValueForKey:@"${2: attribute}"]; + [self setPrimitiveValue:aValue forKey:@"${2: attribute}"]; + [self didChangeValueForKey:@"${2: attribute}"]; +} \ No newline at end of file diff --git a/extras/imported/objc-mode/Accessor Methods For/LoD array (arracc).yasnippet b/extras/imported/objc-mode/Accessor Methods For/LoD array (arracc).yasnippet new file mode 100644 index 0000000..7424176 --- /dev/null +++ b/extras/imported/objc-mode/Accessor Methods For/LoD array (arracc).yasnippet @@ -0,0 +1,45 @@ +# -*- mode: snippet -*- +# key: arracc +# contributor: Translated from TextMate Snippet +# name: KVC Array +## condition: "(source.objc | source.objc++) & meta.scope.implementation.objc - meta.function-with-body" +# -- +- (void)addObjectTo${1:Things}:(${2:id})anObject +{ + [${3:${1/./\l$0/}} addObject:anObject]; +} + +- (void)insertObject:($2)anObject in$1AtIndex:(unsigned int)i +{ + [$3 insertObject:anObject atIndex:i]; +} + +- ($2)objectIn$1AtIndex:(unsigned int)i +{ + return [$3 objectAtIndex:i]; +} + +- (unsigned int)indexOfObjectIn$1:($2)anObject +{ + return [$3 indexOfObject:anObject]; +} + +- (void)removeObjectFrom$1AtIndex:(unsigned int)i +{ + [$3 removeObjectAtIndex:i]; +} + +- (unsigned int)countOf$1 +{ + return [$3 count]; +} + +- (NSArray${TM_C_POINTER/(^(.+?)\s*$)?/(?1:$2: *)/})${1/./\l$0/} +{ + return $3; +} + +- (void)set$1:(NSArray${TM_C_POINTER/(^(.+?)\s*$)?/(?1:$2: *)/})new$1 +{ + [$3 setArray:new$1]; +} \ No newline at end of file diff --git a/extras/imported/objc-mode/Accessor Methods For/Property.yasnippet b/extras/imported/objc-mode/Accessor Methods For/Property.yasnippet new file mode 100644 index 0000000..e31a2e3 --- /dev/null +++ b/extras/imported/objc-mode/Accessor Methods For/Property.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: prop +# contributor: Translated from TextMate Snippet +# name: Property (Objective-C 2.0) +## condition: "source.objc meta.scope.interface, source.objc++ meta.scope.interface" +# -- +@property (${1/^(e)$|.*/(?1:r)/}${1:r}${1/^(?:(r)|(e)|(c)|(a))$|.*/(?1:etain)(?2:adonly)(?3:opy)(?4:ssign)/}) ${2:NSSomeClass}${TM_C_POINTER: *}${3:${2/^[A-Z](?:[A-Z]+|[a-z]+)([A-Z]\w*)/\l$1/}}; \ No newline at end of file diff --git a/extras/imported/objc-mode/Accessor Methods For/Scalar Accessors (acc).yasnippet b/extras/imported/objc-mode/Accessor Methods For/Scalar Accessors (acc).yasnippet new file mode 100644 index 0000000..49a6a09 --- /dev/null +++ b/extras/imported/objc-mode/Accessor Methods For/Scalar Accessors (acc).yasnippet @@ -0,0 +1,15 @@ +# -*- mode: snippet -*- +# key: acc +# contributor: Translated from TextMate Snippet +# name: Primitive Type +## condition: "(source.objc | source.objc++) & meta.scope.implementation.objc - meta.function-with-body" +# -- +- (${1:unsigned int})${2:thing} +{ + return ${3:$2}; +} + +- (void)set${2/./\u$0/}:(${1:unsigned int})new${2/./\u$0/} +{ + $3 = new${2/./\u$0/}; +} \ No newline at end of file diff --git a/extras/imported/objc-mode/Accessor Methods For/String Accessors (stracc).yasnippet b/extras/imported/objc-mode/Accessor Methods For/String Accessors (stracc).yasnippet new file mode 100644 index 0000000..4774d8b --- /dev/null +++ b/extras/imported/objc-mode/Accessor Methods For/String Accessors (stracc).yasnippet @@ -0,0 +1,17 @@ +# -*- mode: snippet -*- +# key: stracc +# contributor: Translated from TextMate Snippet +# name: String +## condition: "(source.objc | source.objc++) & meta.scope.implementation.objc - meta.function-with-body" +# -- +- (NSString${TM_C_POINTER/(^(.+?)\s*$)?/(?1:$2: *)/})${1:thing} +{ + return ${2:$1}; +} + +- (void)set${1/.*/\u$0/}:(NSString${TM_C_POINTER/(^(.+?)\s*$)?/(?1:$2: *)/})${3:a${1/.*/\u$0/}} +{ + $3 = [$3 copy]; + [$2 release]; + $2 = $3; +} \ No newline at end of file diff --git a/extras/imported/objc-mode/Accessor Methods For/Synthesize.yasnippet b/extras/imported/objc-mode/Accessor Methods For/Synthesize.yasnippet new file mode 100644 index 0000000..85805c5 --- /dev/null +++ b/extras/imported/objc-mode/Accessor Methods For/Synthesize.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: syn +# contributor: Translated from TextMate Snippet +# name: Synthesize Property +## condition: "(source.objc | source.objc++) & meta.scope.implementation.objc - meta.function-with-body" +# -- +@synthesize ${1:property}; \ No newline at end of file diff --git a/extras/imported/objc-mode/Class Method Interface (M).yasnippet b/extras/imported/objc-mode/Class Method Interface (M).yasnippet new file mode 100644 index 0000000..bed98fc --- /dev/null +++ b/extras/imported/objc-mode/Class Method Interface (M).yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: M +# contributor: Translated from TextMate Snippet +# name: Interface: Class Method +## condition: "source.objc meta.scope.interface, source.objc++ meta.scope.interface" +# -- ++ (${1:id})${0:method}; \ No newline at end of file diff --git a/extras/imported/objc-mode/Common Method Calls/Detach New NSThread.yasnippet b/extras/imported/objc-mode/Common Method Calls/Detach New NSThread.yasnippet new file mode 100644 index 0000000..3b2be9e --- /dev/null +++ b/extras/imported/objc-mode/Common Method Calls/Detach New NSThread.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: thread +# contributor: Translated from TextMate Snippet +# name: Detach New NSThread +## condition: "source.objc, source.objc++" +# -- +[NSThread detachNewThreadSelector:@selector(${1:method}:) toTarget:${2:aTarget} withObject:${3:anArgument}] \ No newline at end of file diff --git a/extras/imported/objc-mode/Common Method Calls/Keyvalue binding (bind).yasnippet b/extras/imported/objc-mode/Common Method Calls/Keyvalue binding (bind).yasnippet new file mode 100644 index 0000000..89252ba --- /dev/null +++ b/extras/imported/objc-mode/Common Method Calls/Keyvalue binding (bind).yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: bind +# contributor: Translated from TextMate Snippet +# name: Bind Property to Key Path of Object +## condition: "source.objc, source.objc++" +# -- +bind:@"${2:binding}" toObject:${3:observableController} withKeyPath:@"${4:keyPath}" options:${5:nil} \ No newline at end of file diff --git a/extras/imported/objc-mode/Common Method Calls/NSLog (log) 2.yasnippet b/extras/imported/objc-mode/Common Method Calls/NSLog (log) 2.yasnippet new file mode 100644 index 0000000..7fc8893 --- /dev/null +++ b/extras/imported/objc-mode/Common Method Calls/NSLog (log) 2.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: log +# contributor: Translated from TextMate Snippet +# name: NSLog(…) +## condition: "source.objc, source.objc++" +# -- +NSLog(@"$1"${1/[^%]*(%)?.*/(?1:, :\);)/}$2${1/[^%]*(%)?.*/(?1:\);)/} \ No newline at end of file diff --git a/extras/imported/objc-mode/Common Method Calls/NSRunAlertPanel (alert).yasnippet b/extras/imported/objc-mode/Common Method Calls/NSRunAlertPanel (alert).yasnippet new file mode 100644 index 0000000..36f0623 --- /dev/null +++ b/extras/imported/objc-mode/Common Method Calls/NSRunAlertPanel (alert).yasnippet @@ -0,0 +1,15 @@ +# -*- mode: snippet -*- +# key: alert +# contributor: Translated from TextMate Snippet +# name: NSRunAlertPanel +## condition: "source.objc, source.objc++" +# -- +int choice = NSRunAlertPanel(@"${1:Something important!}", @"${2:Something important just happend, and now I need to ask you, do you want to continue?}", @"${3:Continue}", @"${4:Cancel}", nil); +if(choice == NSAlertDefaultReturn) // "${3:Continue}" +{ + $0; +} +else if(choice == NSAlertAlternateReturn) // "${4:Cancel}" +{ + +} \ No newline at end of file diff --git a/extras/imported/objc-mode/Common Method Calls/Read from defaults (getprefs).yasnippet b/extras/imported/objc-mode/Common Method Calls/Read from defaults (getprefs).yasnippet new file mode 100644 index 0000000..8b479fb --- /dev/null +++ b/extras/imported/objc-mode/Common Method Calls/Read from defaults (getprefs).yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: getprefs +# contributor: Translated from TextMate Snippet +# name: Read Defaults Value +## condition: "source.objc, source.objc++" +# -- +[[NSUserDefaults standardUserDefaults] objectForKey:${1:key}]; \ No newline at end of file diff --git a/extras/imported/objc-mode/Common Method Calls/Register for Notification.yasnippet b/extras/imported/objc-mode/Common Method Calls/Register for Notification.yasnippet new file mode 100644 index 0000000..ea1d44d --- /dev/null +++ b/extras/imported/objc-mode/Common Method Calls/Register for Notification.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: obs +# contributor: Translated from TextMate Snippet +# name: Register for Notification +## condition: "source.objc meta.scope.implementation, source.objc++ meta.scope.implementation" +# -- +[[NSNotificationCenter defaultCenter] addObserver:${1:self} selector:@selector(${3:${2/^([A-Z]{2})?(.+?)(Notification)?$/\l$2/}}:) name:${2:NSWindowDidBecomeMainNotification} object:${4:nil}]; \ No newline at end of file diff --git a/extras/imported/objc-mode/Common Method Calls/Write to defaults (setprefs).yasnippet b/extras/imported/objc-mode/Common Method Calls/Write to defaults (setprefs).yasnippet new file mode 100644 index 0000000..a15c48c --- /dev/null +++ b/extras/imported/objc-mode/Common Method Calls/Write to defaults (setprefs).yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: setprefs +# contributor: Translated from TextMate Snippet +# name: Write Defaults Value +## condition: "source.objc, source.objc++" +# -- +[[NSUserDefaults standardUserDefaults] setObject:${1:object} forKey:${2:key}]; \ No newline at end of file diff --git a/extras/imported/objc-mode/Format Method Signature.yasnippet b/extras/imported/objc-mode/Format Method Signature.yasnippet new file mode 100644 index 0000000..f8a79f0 --- /dev/null +++ b/extras/imported/objc-mode/Format Method Signature.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# type: command +# contributor: Translated from TextMate Snippet +# name: Reformat Method Signature +## binding: "^q" +## condition: "meta.function.objc" +# -- diff --git a/extras/imported/objc-mode/Idioms/080 for NSArray loop (forarray).yasnippet b/extras/imported/objc-mode/Idioms/080 for NSArray loop (forarray).yasnippet new file mode 100644 index 0000000..8ad1b47 --- /dev/null +++ b/extras/imported/objc-mode/Idioms/080 for NSArray loop (forarray).yasnippet @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +# key: forarray +# contributor: Translated from TextMate Snippet +# name: NSArray Loop +## condition: "source.objc, source.objc++" +# -- +unsigned int ${1:object}Count = [${2:array} count]; + +for(unsigned int index = 0; index < ${1}Count; index += 1) +{ + ${3:id} ${1} = [$2 objectAtIndex:index]; + $0 +} \ No newline at end of file diff --git a/extras/imported/objc-mode/Idioms/Delegate Responds to Selector.yasnippet b/extras/imported/objc-mode/Idioms/Delegate Responds to Selector.yasnippet new file mode 100644 index 0000000..6c70851 --- /dev/null +++ b/extras/imported/objc-mode/Idioms/Delegate Responds to Selector.yasnippet @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# key: delegate +# contributor: Translated from TextMate Snippet +# name: Delegate Responds to Selector +## condition: "source.objc, source.objc++" +# -- +if([${1:[self delegate]} respondsToSelector:@selector(${2:selfDidSomething:})]) + [$1 ${3:${2/((^\s*([A-Za-z0-9_]*:)\s*)|(:\s*$)|(:\s*))/(?2:$2self :\:<>)(?4::)(?5: :)/g}}]; diff --git a/extras/imported/objc-mode/Idioms/Lock Focus.yasnippet b/extras/imported/objc-mode/Idioms/Lock Focus.yasnippet new file mode 100644 index 0000000..e0592a5 --- /dev/null +++ b/extras/imported/objc-mode/Idioms/Lock Focus.yasnippet @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# key: focus +# contributor: Translated from TextMate Snippet +# name: Lock Focus +## condition: "source.objc, source.objc++" +# -- +[self lockFocus]; +$0 +[self unlockFocus]; \ No newline at end of file diff --git a/extras/imported/objc-mode/Idioms/NSAutoreleasePool (pool).yasnippet b/extras/imported/objc-mode/Idioms/NSAutoreleasePool (pool).yasnippet new file mode 100644 index 0000000..e3d3454 --- /dev/null +++ b/extras/imported/objc-mode/Idioms/NSAutoreleasePool (pool).yasnippet @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# key: pool +# contributor: Translated from TextMate Snippet +# name: NSAutoreleasePool +## condition: "source.objc, source.objc++" +# -- +NSAutoreleasePool${TM_C_POINTER: *}pool = [NSAutoreleasePool new]; +$0 +[pool drain]; \ No newline at end of file diff --git a/extras/imported/objc-mode/Idioms/Responds to Selector.yasnippet b/extras/imported/objc-mode/Idioms/Responds to Selector.yasnippet new file mode 100644 index 0000000..7ca65d8 --- /dev/null +++ b/extras/imported/objc-mode/Idioms/Responds to Selector.yasnippet @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# key: responds +# contributor: Translated from TextMate Snippet +# name: Responds to Selector +## condition: "source.objc, source.objc++" +# -- +${TM_COMMENT_START} ${4:Send $2 to $1, if $1 supports it}${TM_COMMENT_END} +if ([${1:self} respondsToSelector:@selector(${2:someSelector:})]) +{ + [$1 ${3:${2/((:\s*$)|(:\s*))/:<>(?3: )/g}}]; +} \ No newline at end of file diff --git a/extras/imported/objc-mode/Idioms/Save and Restore Graphics Context (gsave).yasnippet b/extras/imported/objc-mode/Idioms/Save and Restore Graphics Context (gsave).yasnippet new file mode 100644 index 0000000..5a4782c --- /dev/null +++ b/extras/imported/objc-mode/Idioms/Save and Restore Graphics Context (gsave).yasnippet @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# key: gsave +# contributor: Translated from TextMate Snippet +# name: Save and Restore Graphics Context +## condition: "source.objc, source.objc++" +# -- +[NSGraphicsContext saveGraphicsState]; +$0 +[NSGraphicsContext restoreGraphicsState]; diff --git a/extras/imported/objc-mode/Insert Call to Super.yasnippet b/extras/imported/objc-mode/Insert Call to Super.yasnippet new file mode 100644 index 0000000..dfa425a --- /dev/null +++ b/extras/imported/objc-mode/Insert Call to Super.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# type: command +# key: super +# contributor: Translated from TextMate Snippet +# name: Insert Call to Super +## condition: "source.objc meta.scope.implementation, source.objc++ meta.scope.implementation" +# -- diff --git "a/extras/imported/objc-mode/Language Boilerplate/#import \"\" (imp).yasnippet" "b/extras/imported/objc-mode/Language Boilerplate/#import \"\" (imp).yasnippet" new file mode 100644 index 0000000..8107172 --- /dev/null +++ "b/extras/imported/objc-mode/Language Boilerplate/#import \"\" (imp).yasnippet" @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: imp +# contributor: Translated from TextMate Snippet +# name: #import "…" +## condition: "source.objc, source.objc++" +# -- +#import "${1:${TM_FILENAME/\...*$/.h/}}" \ No newline at end of file diff --git a/extras/imported/objc-mode/Language Boilerplate/#import (Imp).yasnippet b/extras/imported/objc-mode/Language Boilerplate/#import (Imp).yasnippet new file mode 100644 index 0000000..fc41109 --- /dev/null +++ b/extras/imported/objc-mode/Language Boilerplate/#import (Imp).yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: Imp +# contributor: Translated from TextMate Snippet +# name: #import <…> +## condition: "source.objc, source.objc++" +# -- +#import <${1:Cocoa/Cocoa.h}> \ No newline at end of file diff --git a/extras/imported/objc-mode/Language Boilerplate/020 Class (objc).yasnippet b/extras/imported/objc-mode/Language Boilerplate/020 Class (objc).yasnippet new file mode 100644 index 0000000..d295652 --- /dev/null +++ b/extras/imported/objc-mode/Language Boilerplate/020 Class (objc).yasnippet @@ -0,0 +1,20 @@ +# -*- mode: snippet -*- +# key: cl +# contributor: Translated from TextMate Snippet +# name: Class +## condition: "source.objc, source.objc++ - meta.scope.implementation.objc" +# -- +@interface ${1:${TM_FILENAME/\...*$|(^$)/(?1:object)/}} : ${2:NSObject} +{ +} +@end + +@implementation $1 +- (id)init +{ + if((self = [super init])) + {$0 + } + return self; +} +@end \ No newline at end of file diff --git a/extras/imported/objc-mode/Language Boilerplate/050 Method (m).yasnippet b/extras/imported/objc-mode/Language Boilerplate/050 Method (m).yasnippet new file mode 100644 index 0000000..5b655e2 --- /dev/null +++ b/extras/imported/objc-mode/Language Boilerplate/050 Method (m).yasnippet @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# key: m +# contributor: Translated from TextMate Snippet +# name: Method +## binding: "^M" +## condition: "(source.objc | source.objc++) & meta.scope.implementation.objc - meta.function-with-body" +# -- +- (${1:id})${2:${TM_SELECTED_TEXT:method}}${3::(${4:id})${5:${4/(NS([AEIOQUY])?(\w+).*)|(.)?.*/(?1:a(?2:n$2)$3:(?4:anArgument))/}}} +{$0${1/^(void|IBAction)$|(.*)/(?2: + return nil;)/} +} \ No newline at end of file diff --git a/extras/imported/objc-mode/Language Boilerplate/060 SubMethod (sm).yasnippet b/extras/imported/objc-mode/Language Boilerplate/060 SubMethod (sm).yasnippet new file mode 100644 index 0000000..38346b9 --- /dev/null +++ b/extras/imported/objc-mode/Language Boilerplate/060 SubMethod (sm).yasnippet @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# key: sm +# contributor: Translated from TextMate Snippet +# name: Sub-method (Call Super) +## condition: "(source.objc | source.objc++) & meta.scope.implementation.objc - meta.function-with-body" +# -- +- (${1:id})${2:method}${3::(${4:id})${5:${4/(NS([AEIOQUY])?(\w+).*)|(.)?.*/(?1:a(?2:n$2)$3:(?4:anArgument))/}}} +{ + ${1/^(void|IBAction)$|(.*)/(?2:$2 res = )/}[super ${2:method}${5/.+/:$0/}];$0${1/^(void|IBAction)$|(.*)/(?2: + return res;)/} +} \ No newline at end of file diff --git a/extras/imported/objc-mode/Language Boilerplate/Category (cat).yasnippet b/extras/imported/objc-mode/Language Boilerplate/Category (cat).yasnippet new file mode 100644 index 0000000..4942035 --- /dev/null +++ b/extras/imported/objc-mode/Language Boilerplate/Category (cat).yasnippet @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# key: cat +# contributor: Translated from TextMate Snippet +# name: Category +## condition: "source.objc, source.objc++" +# -- +@interface ${1:${TM_FILENAME/.*?(\w+).*|.*/(?1:$1:NSObject)/}} (${2:${TM_FILENAME/.*?\w+\W+(\w+).*\..+|.*/(?1:$1:Category)/}}) +@end + +@implementation $1 ($2) +$0 +@end \ No newline at end of file diff --git a/extras/imported/objc-mode/Language Boilerplate/Category Implementation.yasnippet b/extras/imported/objc-mode/Language Boilerplate/Category Implementation.yasnippet new file mode 100644 index 0000000..6ecb5b3 --- /dev/null +++ b/extras/imported/objc-mode/Language Boilerplate/Category Implementation.yasnippet @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# key: catm +# contributor: Translated from TextMate Snippet +# name: Category Implementation +## condition: "source.objc, source.objc++" +# -- +@implementation ${1:${TM_FILENAME/.*?(\w+).*|.*/(?1:$1:NSObject)/}} (${2:${TM_FILENAME/.*?\w+\W+(\w+).*\..+|.*/(?1:$1:Category)/}}) +$0 +@end \ No newline at end of file diff --git a/extras/imported/objc-mode/Language Boilerplate/Category Interface Only (cati).yasnippet b/extras/imported/objc-mode/Language Boilerplate/Category Interface Only (cati).yasnippet new file mode 100644 index 0000000..4c9cd76 --- /dev/null +++ b/extras/imported/objc-mode/Language Boilerplate/Category Interface Only (cati).yasnippet @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# key: cath +# contributor: Translated from TextMate Snippet +# name: Category Interface +## condition: "source.objc, source.objc++" +# -- +@interface ${1:${TM_FILENAME/.*?(\w+).*|.*/(?1:$1:NSObject)/}} (${2:${TM_FILENAME/.*?\w+\W+(\w+).*\..+|.*/(?1:$1:Category)/}}) +$0 +@end \ No newline at end of file diff --git a/extras/imported/objc-mode/Language Boilerplate/Class Implementation.yasnippet b/extras/imported/objc-mode/Language Boilerplate/Class Implementation.yasnippet new file mode 100644 index 0000000..9d898b3 --- /dev/null +++ b/extras/imported/objc-mode/Language Boilerplate/Class Implementation.yasnippet @@ -0,0 +1,15 @@ +# -*- mode: snippet -*- +# key: clm +# contributor: Translated from TextMate Snippet +# name: Class Implementation +## condition: "source.objc, source.objc++" +# -- +@implementation ${1:${TM_FILENAME/\...*$|(^$)/(?1:object)/}} +- (id)init +{ + if((self = [super init])) + {$0 + } + return self; +} +@end \ No newline at end of file diff --git a/extras/imported/objc-mode/Language Boilerplate/Class Interface Only (classi).yasnippet b/extras/imported/objc-mode/Language Boilerplate/Class Interface Only (classi).yasnippet new file mode 100644 index 0000000..5f68db9 --- /dev/null +++ b/extras/imported/objc-mode/Language Boilerplate/Class Interface Only (classi).yasnippet @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# key: clh +# contributor: Translated from TextMate Snippet +# name: Class Interface +## condition: "source.objc, source.objc++" +# -- +@interface ${1:${TM_FILENAME/\...*$|(^$)/(?1:object)/}} : ${2:NSObject} +{$3 +} +$0 +@end \ No newline at end of file diff --git a/extras/imported/objc-mode/Language Boilerplate/Class Method (M).yasnippet b/extras/imported/objc-mode/Language Boilerplate/Class Method (M).yasnippet new file mode 100644 index 0000000..59c5f81 --- /dev/null +++ b/extras/imported/objc-mode/Language Boilerplate/Class Method (M).yasnippet @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# key: M +# contributor: Translated from TextMate Snippet +# name: Class Method +## condition: "(source.objc | source.objc++) & meta.scope.implementation.objc - meta.function-with-body" +# -- ++ (${1:id})${2:method}${3::(${4:id})${5:${4/(NS([AEIOQUY])?(\w+).*)|(.)?.*/(?1:a(?2:n$2)$3:(?4:anArgument))/}}} +{$0${1/^(void|IBAction)$|(.*)/(?2: + return nil;)/} +} \ No newline at end of file diff --git a/extras/imported/objc-mode/Language Boilerplate/IBOutlet (ibo).yasnippet b/extras/imported/objc-mode/Language Boilerplate/IBOutlet (ibo).yasnippet new file mode 100644 index 0000000..d2e246d --- /dev/null +++ b/extras/imported/objc-mode/Language Boilerplate/IBOutlet (ibo).yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: ibo +# contributor: Translated from TextMate Snippet +# name: IBOutlet +## condition: "source.objc, source.objc++" +# -- +IBOutlet ${1:NSSomeClass}${TM_C_POINTER: *}${2:${1/^[A-Z](?:[A-Z]+|[a-z]+)([A-Z]\w*)/\l$1/}}; \ No newline at end of file diff --git a/extras/imported/objc-mode/Language Boilerplate/Initialize Implementation (I).yasnippet b/extras/imported/objc-mode/Language Boilerplate/Initialize Implementation (I).yasnippet new file mode 100644 index 0000000..4b66416 --- /dev/null +++ b/extras/imported/objc-mode/Language Boilerplate/Initialize Implementation (I).yasnippet @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# key: I +# contributor: Translated from TextMate Snippet +# name: Method: Initialize +## condition: "(source.objc | source.objc++) & meta.scope.implementation.objc - meta.function-with-body" +# -- ++ (void)initialize +{ + [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: + $0@"value", @"key", + nil]]; +} \ No newline at end of file diff --git a/extras/imported/objc-mode/LoD array interface (arracc).yasnippet b/extras/imported/objc-mode/LoD array interface (arracc).yasnippet new file mode 100644 index 0000000..e29d31f --- /dev/null +++ b/extras/imported/objc-mode/LoD array interface (arracc).yasnippet @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +# key: arracc +# contributor: Translated from TextMate Snippet +# name: Interface: Accessors for KVC Array +## condition: "source.objc meta.scope.interface, source.objc++ meta.scope.interface" +# -- +- (void)addObjectTo${1:Things}:(${2:id})anObject; +- (void)insertObject:($2)anObject in$1AtIndex:(unsigned int)i; +- ($2)objectIn$1AtIndex:(unsigned int)i; +- (unsigned int)indexOfObjectIn$1:($2)anObject; +- (void)removeObjectFrom$1AtIndex:(unsigned int)i; +- (unsigned int)countOf$1; +- (NSArray${TM_C_POINTER/(^(.+?)\s*$)?/(?1:$2: *)/})${1/./\l$0/}; +- (void)set$1:(NSArray${TM_C_POINTER/(^(.+?)\s*$)?/(?1:$2: *)/})new$1; \ No newline at end of file diff --git a/extras/imported/objc-mode/Lookup Cocoa Class.yasnippet b/extras/imported/objc-mode/Lookup Cocoa Class.yasnippet new file mode 100644 index 0000000..2975bd4 --- /dev/null +++ b/extras/imported/objc-mode/Lookup Cocoa Class.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# type: command +# contributor: Translated from TextMate Snippet +# name: Documentation for Word / Selection +## binding: "^h" +## condition: "source.c, source.c++, source.objc, source.objc++, (source.objc support | source.objc++ support) - support.function.any-method" +# -- diff --git a/extras/imported/objc-mode/Method Interface (m).yasnippet b/extras/imported/objc-mode/Method Interface (m).yasnippet new file mode 100644 index 0000000..dc228a4 --- /dev/null +++ b/extras/imported/objc-mode/Method Interface (m).yasnippet @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# key: m +# contributor: Translated from TextMate Snippet +# name: Interface: Method +## binding: "^M" +## condition: "source.objc meta.scope.interface, source.objc++ meta.scope.interface" +# -- +- (${1:id})${2:${TM_SELECTED_TEXT:method}}${3::(${4:id})${5:${4/(NS([AEIOQUY])?(\w+).*)|(.)?.*/(?1:a(?2:n$2)$3:(?4:anArgument))/}}}; \ No newline at end of file diff --git a/extras/imported/objc-mode/NSLog(.., _cmd) (log).yasnippet b/extras/imported/objc-mode/NSLog(.., _cmd) (log).yasnippet new file mode 100644 index 0000000..cd05e25 --- /dev/null +++ b/extras/imported/objc-mode/NSLog(.., _cmd) (log).yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: log +# contributor: Translated from TextMate Snippet +# name: NSLog(.., _cmd) +## condition: "source.objc meta.scope.implementation, source.objc++ meta.scope.implementation" +# -- +NSLog(@"%s$1", _cmd${1/[^%]*(%)?.*/(?1:, :\);)/}$2${1/[^%]*(%)?.*/(?1:\);)/} \ No newline at end of file diff --git a/extras/imported/objc-mode/Object Accessors Interface (objacc).yasnippet b/extras/imported/objc-mode/Object Accessors Interface (objacc).yasnippet new file mode 100644 index 0000000..42489f9 --- /dev/null +++ b/extras/imported/objc-mode/Object Accessors Interface (objacc).yasnippet @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# key: objacc +# contributor: Translated from TextMate Snippet +# name: Interface: Accessors for Object +## condition: "source.objc meta.scope.interface, source.objc++ meta.scope.interface" +# -- +- (${1:id})${2:thing}; +- (void)set${2/./\u$0/}:($1)aValue; \ No newline at end of file diff --git a/extras/imported/objc-mode/Object Instantiations/030 NSArray (array).yasnippet b/extras/imported/objc-mode/Object Instantiations/030 NSArray (array).yasnippet new file mode 100644 index 0000000..a61c37d --- /dev/null +++ b/extras/imported/objc-mode/Object Instantiations/030 NSArray (array).yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: array +# contributor: Translated from TextMate Snippet +# name: NSArray +## condition: "source.objc, source.objc++" +# -- +NSMutableArray${TM_C_POINTER: *}${1:array} = [NSMutableArray array]; \ No newline at end of file diff --git a/extras/imported/objc-mode/Object Instantiations/040 NSDictionary (dict).yasnippet b/extras/imported/objc-mode/Object Instantiations/040 NSDictionary (dict).yasnippet new file mode 100644 index 0000000..20020d4 --- /dev/null +++ b/extras/imported/objc-mode/Object Instantiations/040 NSDictionary (dict).yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: dict +# contributor: Translated from TextMate Snippet +# name: NSDictionary +## condition: "source.objc, source.objc++" +# -- +NSMutableDictionary${TM_C_POINTER: *}${1:dict} = [NSMutableDictionary dictionary]; \ No newline at end of file diff --git a/extras/imported/objc-mode/Object Instantiations/NSBezierPath (bez).yasnippet b/extras/imported/objc-mode/Object Instantiations/NSBezierPath (bez).yasnippet new file mode 100644 index 0000000..bcd5a7d --- /dev/null +++ b/extras/imported/objc-mode/Object Instantiations/NSBezierPath (bez).yasnippet @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# key: bez +# contributor: Translated from TextMate Snippet +# name: NSBezierPath +## condition: "source.objc, source.objc++" +# -- +NSBezierPath${TM_C_POINTER: *}${1:path} = [NSBezierPath bezierPath]; +$0 \ No newline at end of file diff --git a/extras/imported/objc-mode/Object Instantiations/NSString stringWithFormat (format).yasnippet b/extras/imported/objc-mode/Object Instantiations/NSString stringWithFormat (format).yasnippet new file mode 100644 index 0000000..585d7d7 --- /dev/null +++ b/extras/imported/objc-mode/Object Instantiations/NSString stringWithFormat (format).yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: format +# contributor: Translated from TextMate Snippet +# name: NSString With Format +## condition: "source.objc, source.objc++" +# -- +[NSString stringWithFormat:@"$1", $2]$0 \ No newline at end of file diff --git a/extras/imported/objc-mode/Scalar Accessors Interface (acc).yasnippet b/extras/imported/objc-mode/Scalar Accessors Interface (acc).yasnippet new file mode 100644 index 0000000..e8c6335 --- /dev/null +++ b/extras/imported/objc-mode/Scalar Accessors Interface (acc).yasnippet @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# key: acc +# contributor: Translated from TextMate Snippet +# name: Interface: Accessors for Primitive Type +## condition: "source.objc meta.scope.interface, source.objc++ meta.scope.interface" +# -- +- (${1:unsigned int})${2:thing}; +- (void)set${2/./\u$0/}:($1)new${2/./\u$0/}; \ No newline at end of file diff --git a/extras/imported/objc-mode/String Accessors Interface (stracc).yasnippet b/extras/imported/objc-mode/String Accessors Interface (stracc).yasnippet new file mode 100644 index 0000000..a350c7a --- /dev/null +++ b/extras/imported/objc-mode/String Accessors Interface (stracc).yasnippet @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# key: stracc +# contributor: Translated from TextMate Snippet +# name: Interface: Accessors for String +## condition: "source.objc meta.scope.interface, source.objc++ meta.scope.interface" +# -- +- (NSString${TM_C_POINTER/(^(.+?)\s*$)?/(?1:$2: *)/})${1:thing}; +- (void)set${1/./\u$0/}:(NSString${TM_C_POINTER/(^(.+?)\s*$)?/(?1:$2: *)/})${2:a${1/.*/\u$0/}}; \ No newline at end of file diff --git a/extras/imported/objc-mode/Wrap in alloc init (alloc).yasnippet b/extras/imported/objc-mode/Wrap in alloc init (alloc).yasnippet new file mode 100644 index 0000000..e2b6544 --- /dev/null +++ b/extras/imported/objc-mode/Wrap in alloc init (alloc).yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# type: command +# key: alloc +# contributor: Translated from TextMate Snippet +# name: Insert [[[… alloc] init] autorelease] +## condition: "source.objc, source.objc++" +# -- diff --git a/extras/imported/objc-mode/selector.yasnippet b/extras/imported/objc-mode/selector.yasnippet new file mode 100644 index 0000000..17d7876 --- /dev/null +++ b/extras/imported/objc-mode/selector.yasnippet @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: sel +# contributor: Translated from TextMate Snippet +# name: @selector(…) +## condition: "source.objc, source.objc++" +# -- +@selector(${1:method}:) \ No newline at end of file