Skip to content

Commit 2522613

Browse files
committed
Ready to expand enums immediately (without waiting IDEIndexDidChangeNotification Notification).
This commit includes so waste code.
1 parent 61734fa commit 2522613

12 files changed

+324
-65
lines changed

SCXcodeSwitchExpander.xcodeproj/project.pbxproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
18990B3618D2529C007A8756 /* SCXcodeSwitchExpander.m in Sources */ = {isa = PBXBuildFile; fileRef = 18990B3518D2529C007A8756 /* SCXcodeSwitchExpander.m */; };
1414
18A1B48118DDA742007CA06A /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18A1B48018DDA742007CA06A /* IDEFoundation.framework */; };
1515
18ECEB5718D267A0005F6C59 /* DVTTextCompletionController+SCXcodeSwitchExpander.m in Sources */ = {isa = PBXBuildFile; fileRef = 18ECEB5618D267A0005F6C59 /* DVTTextCompletionController+SCXcodeSwitchExpander.m */; };
16+
B18173D81CBB91E400995105 /* DVTSourceCodeLanguage+SCXCodeSwitchExpander.m in Sources */ = {isa = PBXBuildFile; fileRef = B18173D71CBB91E400995105 /* DVTSourceCodeLanguage+SCXCodeSwitchExpander.m */; };
17+
B1F83C541CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.m in Sources */ = {isa = PBXBuildFile; fileRef = B1F83C531CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.m */; };
1618
/* End PBXBuildFile section */
1719

1820
/* Begin PBXFileReference section */
@@ -41,6 +43,13 @@
4143
18A1B48018DDA742007CA06A /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = ../../../../Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework; sourceTree = "<group>"; };
4244
18ECEB5518D267A0005F6C59 /* DVTTextCompletionController+SCXcodeSwitchExpander.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTTextCompletionController+SCXcodeSwitchExpander.h"; sourceTree = "<group>"; };
4345
18ECEB5618D267A0005F6C59 /* DVTTextCompletionController+SCXcodeSwitchExpander.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DVTTextCompletionController+SCXcodeSwitchExpander.m"; sourceTree = "<group>"; };
46+
B18173D61CBB91E400995105 /* DVTSourceCodeLanguage+SCXCodeSwitchExpander.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTSourceCodeLanguage+SCXCodeSwitchExpander.h"; sourceTree = "<group>"; };
47+
B18173D71CBB91E400995105 /* DVTSourceCodeLanguage+SCXCodeSwitchExpander.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DVTSourceCodeLanguage+SCXCodeSwitchExpander.m"; sourceTree = "<group>"; };
48+
B18173D91CBB92C700995105 /* DVTSourceCodeLanguage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTSourceCodeLanguage.h; sourceTree = "<group>"; };
49+
B18173DA1CBB958300995105 /* DVTTextStorage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTTextStorage.h; sourceTree = "<group>"; };
50+
B1F83C521CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDEWorkspace+SCXCodeSwitchExpander.h"; sourceTree = "<group>"; };
51+
B1F83C531CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDEWorkspace+SCXCodeSwitchExpander.m"; sourceTree = "<group>"; };
52+
B1F83C551CB9090F00843242 /* IDEWorkspace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEWorkspace.h; sourceTree = "<group>"; };
4453
/* End PBXFileReference section */
4554

4655
/* Begin PBXFrameworksBuildPhase section */
@@ -63,10 +72,12 @@
6372
children = (
6473
0144D9921B06F9F00012D7A2 /* DVTCompletingTextView.h */,
6574
0144D9971B06F9F00012D7A2 /* DVTSourceCodeSymbolKind.h */,
75+
B18173D91CBB92C700995105 /* DVTSourceCodeLanguage.h */,
6676
0144D9991B06F9F00012D7A2 /* DVTSourceTextView.h */,
6777
0144D99A1B06F9F00012D7A2 /* DVTTextCompletionController.h */,
6878
0144D99B1B06F9F00012D7A2 /* DVTTextCompletionListWindowController.h */,
6979
0144D99C1B06F9F00012D7A2 /* DVTTextCompletionSession.h */,
80+
B18173DA1CBB958300995105 /* DVTTextStorage.h */,
7081
185293151B085C4200A2E2C7 /* DVTViewController.h */,
7182
0144D99F1B06F9F00012D7A2 /* IDEEditor.h */,
7283
0144D9B11B06FBD30012D7A2 /* IDEFileTextSettings.h */,
@@ -75,6 +86,7 @@
7586
0144D9A21B06F9F00012D7A2 /* IDEIndexCompletionItem.h */,
7687
0144D9A31B06F9F00012D7A2 /* IDEIndexContainerSymbol.h */,
7788
0144D9A61B06F9F00012D7A2 /* IDEIndexSymbol.h */,
89+
B1F83C551CB9090F00843242 /* IDEWorkspace.h */,
7890
);
7991
path = "Xcode Headers";
8092
sourceTree = "<group>";
@@ -114,6 +126,10 @@
114126
18990B3518D2529C007A8756 /* SCXcodeSwitchExpander.m */,
115127
18ECEB5518D267A0005F6C59 /* DVTTextCompletionController+SCXcodeSwitchExpander.h */,
116128
18ECEB5618D267A0005F6C59 /* DVTTextCompletionController+SCXcodeSwitchExpander.m */,
129+
B1F83C521CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.h */,
130+
B1F83C531CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.m */,
131+
B18173D61CBB91E400995105 /* DVTSourceCodeLanguage+SCXCodeSwitchExpander.h */,
132+
B18173D71CBB91E400995105 /* DVTSourceCodeLanguage+SCXCodeSwitchExpander.m */,
117133
18142E1D18E89497006BD329 /* Xcode Headers */,
118134
18990B2918D25239007A8756 /* Supporting Files */,
119135
);
@@ -191,7 +207,9 @@
191207
buildActionMask = 2147483647;
192208
files = (
193209
18ECEB5718D267A0005F6C59 /* DVTTextCompletionController+SCXcodeSwitchExpander.m in Sources */,
210+
B1F83C541CB908CF00843242 /* IDEWorkspace+SCXCodeSwitchExpander.m in Sources */,
194211
18990B3618D2529C007A8756 /* SCXcodeSwitchExpander.m in Sources */,
212+
B18173D81CBB91E400995105 /* DVTSourceCodeLanguage+SCXCodeSwitchExpander.m in Sources */,
195213
);
196214
runOnlyForDeploymentPostprocessing = 0;
197215
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// DVTSourceCodeLanguage+SCXCodeSwitchExpander.h
3+
// SCXcodeSwitchExpander
4+
//
5+
// Created by Tomohiro Kumagai on 4/11/16.
6+
// Copyright © 2016 Stefan Ceriu. All rights reserved.
7+
//
8+
9+
#import "DVTSourceCodeLanguage.h"
10+
11+
typedef NS_ENUM(NSInteger, DVTSourceCodeLanguageKind)
12+
{
13+
DVTSourceCodeLanguageKindObjectiveC,
14+
DVTSourceCodeLanguageKindSwift,
15+
DVTSourceCodeLanguageKindOthers
16+
};
17+
18+
@interface DVTSourceCodeLanguage (SCXCodeSwitchExpander)
19+
20+
@property (readonly) DVTSourceCodeLanguageKind kind;
21+
22+
@end
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//
2+
// DVTSourceCodeLanguage+SCXCodeSwitchExpander.m
3+
// SCXcodeSwitchExpander
4+
//
5+
// Created by Tomohiro Kumagai on 4/11/16.
6+
// Copyright © 2016 Stefan Ceriu. All rights reserved.
7+
//
8+
9+
#import "DVTSourceCodeLanguage+SCXCodeSwitchExpander.h"
10+
11+
@implementation DVTSourceCodeLanguage (SCXCodeSwitchExpander)
12+
13+
- (DVTSourceCodeLanguageKind)kind
14+
{
15+
if ([self.languageName isEqualToString:@"Objective-C"])
16+
{
17+
return DVTSourceCodeLanguageKindObjectiveC;
18+
}
19+
else if ([self.languageName isEqualToString:@"Swift"])
20+
{
21+
return DVTSourceCodeLanguageKindSwift;
22+
}
23+
else
24+
{
25+
return DVTSourceCodeLanguageKindOthers;
26+
}
27+
}
28+
29+
@end

SCXcodeSwitchExpander/DVTTextCompletionController+SCXcodeSwitchExpander.m

Lines changed: 108 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -10,93 +10,112 @@
1010

1111
#import "SCXcodeSwitchExpander.h"
1212

13+
#import "DVTSourceCodeLanguage+SCXcodeSwitchExpander.h"
1314
#import "DVTSourceTextView.h"
15+
#import "DVTTextStorage.h"
1416

1517
#import "IDEIndex.h"
1618
#import "IDEIndexCollection.h"
1719
#import "IDEIndexCompletionItem.h"
1820
#import "IDEIndexContainerSymbol.h"
21+
#import "IDEWorkspace.h"
1922
#import "DVTSourceCodeSymbolKind.h"
23+
#import "DVTSourceTextView.h"
2024

2125
#import "DVTTextCompletionSession.h"
2226

2327
#import <objc/objc-class.h>
2428

2529
/// Returns symbol names from swift style full symbol name (e.g. from `Mirror.DisplayStyle` to `[Mirror, DisplayStyle]`).
26-
NSArray<NSString*>* symbolNamesFromFullSymbolName(NSString* fullSymbolName);
30+
NSArray<NSString*>* symbolNamesFromFullSymbolName(NSString* fullSymbolName, DVTSourceCodeLanguageKind language);
2731

2832
/// Returns normalized symbol name for -[IDEIndex allSymbolsMatchingName:kind:].
29-
NSString* normalizedSymbolName(NSString* symbolName);
33+
NSString* normalizedSymbolName(NSString* symbolName, DVTSourceCodeLanguageKind language);
3034

3135
/// Returns a symbol name removed swift generic parameter (e.g. `SomeType<T>` to `SomeType`).
32-
NSString* symbolNameRemovingGenericParameter(NSString* symbolName);
36+
NSString* symbolNameRemovingGenericParameter(NSString* symbolName, DVTSourceCodeLanguageKind language);
3337

3438
/// Returns a symbol name replaced syntax suggered optional to formal type name type in Swift (e.g. `Int?` to `Optional).
35-
NSString* symbolNameReplacingOptionalName(NSString* symbolName);
39+
NSString* symbolNameReplacingOptionalName(NSString* symbolName, DVTSourceCodeLanguageKind language);
3640

37-
NSArray<NSString*>* symbolNamesFromFullSymbolName(NSString* fullSymbolName)
41+
NSArray<NSString*>* symbolNamesFromFullSymbolName(NSString* fullSymbolName, DVTSourceCodeLanguageKind language)
3842
{
3943
NSMutableArray<NSString*> *names = [[fullSymbolName componentsSeparatedByString:@"."] mutableCopy];
4044

4145
for (NSInteger nameIndex = 0; nameIndex != names.count; ++nameIndex)
4246
{
43-
names[nameIndex] = normalizedSymbolName(names[nameIndex]);
47+
names[nameIndex] = normalizedSymbolName(names[nameIndex], language);
4448
}
4549

4650
return [names copy];
4751
}
4852

49-
NSString* normalizedSymbolName(NSString* symbolName)
53+
NSString* normalizedSymbolName(NSString* symbolName, DVTSourceCodeLanguageKind language)
5054
{
5155
NSString *result = symbolName;
5256

53-
result = symbolNameRemovingGenericParameter(result);
54-
result = symbolNameReplacingOptionalName(result);
57+
result = symbolNameRemovingGenericParameter(result, language);
58+
result = symbolNameReplacingOptionalName(result, language);
5559

5660
return result;
5761
}
5862

59-
NSString* symbolNameRemovingGenericParameter(NSString* symbolName)
63+
NSString* symbolNameRemovingGenericParameter(NSString* symbolName, DVTSourceCodeLanguageKind language)
6064
{
61-
if ([[SCXcodeSwitchExpander sharedSwitchExpander] isSwift])
62-
{
63-
return [symbolName stringByReplacingOccurrencesOfString:@"<[^>]+>$"
64-
withString:@""
65-
options:NSRegularExpressionSearch
66-
range:NSMakeRange(0, symbolName.length)];
67-
}
68-
else
65+
switch (language)
6966
{
70-
return symbolName;
67+
case DVTSourceCodeLanguageKindSwift:
68+
return [symbolName stringByReplacingOccurrencesOfString:@"<[^>]+>$"
69+
withString:@""
70+
options:NSRegularExpressionSearch
71+
range:NSMakeRange(0, symbolName.length)];
72+
73+
case DVTSourceCodeLanguageKindObjectiveC:
74+
case DVTSourceCodeLanguageKindOthers:
75+
return symbolName;
7176
}
7277
}
7378

74-
NSString* symbolNameReplacingOptionalName(NSString* symbolName)
79+
NSString* symbolNameReplacingOptionalName(NSString* symbolName, DVTSourceCodeLanguageKind language)
7580
{
76-
if ([[SCXcodeSwitchExpander sharedSwitchExpander] isSwift])
81+
switch (language)
7782
{
78-
if ([symbolName hasSuffix:@"?"])
79-
{
80-
return @"Optional";
81-
}
82-
else if ([symbolName hasSuffix:@"!"])
83+
case DVTSourceCodeLanguageKindSwift:
8384
{
84-
return @"ImplicitlyUnwrappedOptional";
85+
if ([symbolName hasSuffix:@"?"])
86+
{
87+
return @"Optional";
88+
}
89+
else if ([symbolName hasSuffix:@"!"])
90+
{
91+
return @"ImplicitlyUnwrappedOptional";
92+
}
93+
else
94+
{
95+
return symbolName;
96+
}
8597
}
86-
else
87-
{
98+
99+
case DVTSourceCodeLanguageKindObjectiveC:
100+
case DVTSourceCodeLanguageKindOthers:
88101
return symbolName;
89-
}
90-
}
91-
else
92-
{
93-
return symbolName;
94102
}
95103
}
96104

105+
@interface DVTTextCompletionController (SCXCodeSwitchExpander)
106+
107+
/// Returns the kind of language in current editor.
108+
- (DVTSourceCodeLanguageKind)currentLanguage;
109+
110+
@end
111+
97112
@interface DVTTextCompletionListWindowController (SCXcodeSwitchExpander)
98113

99-
- (BOOL)tryExpandingSwitchStatement;
114+
115+
- (BOOL)tryExpandingSwitchStatementForLanguage:(DVTSourceCodeLanguageKind)language;
116+
117+
/// Returns symbols specified by `fullSymbolName` in Index.
118+
- (NSArray<IDEIndexSymbol*>*)getSymbolsByFullName:(NSString*)fullSymbolName forLanguage:(DVTSourceCodeLanguageKind)language fromIndex:(IDEIndex*)index;
100119

101120
/// Returns symbols that found in top `collection` by names recursively.
102121
- (NSArray<IDEIndexSymbol*>*)findSymbolsWithNames:(NSArray<NSString*>*)names fromCollection:(IDEIndexCollection*)collection;
@@ -129,13 +148,22 @@ + (void)load
129148

130149
- (BOOL)scSwizzledAcceptCurrentCompletion
131150
{
132-
if([self.currentSession.listWindowController tryExpandingSwitchStatement]) {
151+
if([self.currentSession.listWindowController tryExpandingSwitchStatementForLanguage:self.currentLanguage]) {
133152
return YES;
134153
}
135154

136155
return [self scSwizzledAcceptCurrentCompletion];
137156
}
138157

158+
- (DVTSourceCodeLanguageKind)currentLanguage
159+
{
160+
DVTSourceTextView *textView = (DVTSourceTextView *)self.textView;
161+
DVTTextStorage *textStorage = (DVTTextStorage *)textView.textStorage;
162+
DVTSourceCodeLanguage *language = textStorage.language;
163+
164+
return language.kind;
165+
}
166+
139167
@end
140168

141169
@implementation DVTTextCompletionListWindowController (SCXcodeSwitchExpander)
@@ -191,17 +219,17 @@ @implementation DVTTextCompletionListWindowController (SCXcodeSwitchExpander)
191219
}
192220
}
193221

194-
- (NSArray<IDEIndexSymbol*>*)getSymbolsByFullName:(NSString*)fullSymbolName fromIndex:(IDEIndex*)index
222+
- (NSArray<IDEIndexSymbol*>*)getSymbolsByFullName:(NSString*)fullSymbolName forLanguage:(DVTSourceCodeLanguageKind)language fromIndex:(IDEIndex*)index
195223
{
196-
NSArray<NSString*> *names = symbolNamesFromFullSymbolName(fullSymbolName);
224+
NSArray<NSString*> *names = symbolNamesFromFullSymbolName(fullSymbolName, language);
197225
IDEIndexCollection *collection = [index allSymbolsMatchingName:names.firstObject kind:nil];
198226

199227
return [self findSymbolsWithNames:names fromCollection:collection];
200228
}
201229

202-
- (BOOL)tryExpandingSwitchStatement
230+
- (BOOL)tryExpandingSwitchStatementForLanguage:(DVTSourceCodeLanguageKind)language
203231
{
204-
IDEIndex *index = [[SCXcodeSwitchExpander sharedSwitchExpander] index];
232+
IDEIndex *index = [[[SCXcodeSwitchExpander sharedSwitchExpander] currentWorkspace] index];
205233

206234
if(index == nil) {
207235
return NO;
@@ -214,7 +242,7 @@ - (BOOL)tryExpandingSwitchStatement
214242
symbolName = [[symbolName componentsSeparatedByString:@"::"] lastObject]; // Remove C++ namespaces
215243
symbolName = [[symbolName componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] lastObject]; // Remove enum keyword
216244

217-
NSArray<IDEIndexSymbol*> *symbols = [self getSymbolsByFullName:symbolName fromIndex:index];
245+
NSArray<IDEIndexSymbol*> *symbols = [self getSymbolsByFullName:symbolName forLanguage:language fromIndex:index];
218246

219247
// Find the first one of them that is a container
220248
for(IDEIndexSymbol *symbol in symbols) {
@@ -244,8 +272,21 @@ - (BOOL)tryExpandingSwitchStatement
244272
}
245273

246274
// See if the current line has a switch statement
247-
NSString *regPattern = [[SCXcodeSwitchExpander sharedSwitchExpander] isSwift] ? @"\\s+switch\\s*" : @"\\s+switch\\s*\\\(";
248-
NSRange switchRange = [textView.string rangeOfString:regPattern options:NSRegularExpressionSearch range:NSMakeRange(newLineRange.location, self.session.wordStartLocation - newLineRange.location)];
275+
NSString *regPattern;
276+
277+
switch (language)
278+
{
279+
case DVTSourceCodeLanguageKindObjectiveC:
280+
case DVTSourceCodeLanguageKindOthers:
281+
regPattern = @"\\s+switch\\s*\\\(";
282+
break;
283+
284+
case DVTSourceCodeLanguageKindSwift:
285+
regPattern = @"\\s+switch\\s*";
286+
break;
287+
}
288+
289+
NSRange switchRange = [textView.string rangeOfString:regPattern options:NSRegularExpressionSearch range:NSMakeRange(newLineRange.location, self.session.wordStartLocation - newLineRange.location)];
249290
if(switchRange.location == NSNotFound) {
250291
return NO;
251292
}
@@ -276,10 +317,16 @@ - (BOOL)tryExpandingSwitchStatement
276317

277318
NSRange defaultAutocompletionRange;
278319
// Get rid of the default autocompletion if necessary
279-
if ([[SCXcodeSwitchExpander sharedSwitchExpander] isSwift]) {
280-
defaultAutocompletionRange = [textView.string rangeOfString:@"\\s*case .<#constant#>:\\s*<#statements#>\\s*break\\s*default:\\s*break\\s*" options:NSRegularExpressionSearch range:NSMakeRange(openingBracketLocation, closingBracketLocation - openingBracketLocation)];
281-
} else {
282-
defaultAutocompletionRange = [textView.string rangeOfString:@"\\s*case <#constant#>:\\s*<#statements#>\\s*break;\\s*default:\\s*break;\\s*" options:NSRegularExpressionSearch range:NSMakeRange(openingBracketLocation, closingBracketLocation - openingBracketLocation)];
320+
switch (language) {
321+
322+
case DVTSourceCodeLanguageKindSwift:
323+
defaultAutocompletionRange = [textView.string rangeOfString:@"\\s*case .<#constant#>:\\s*<#statements#>\\s*break\\s*default:\\s*break\\s*" options:NSRegularExpressionSearch range:NSMakeRange(openingBracketLocation, closingBracketLocation - openingBracketLocation)];
324+
break;
325+
326+
case DVTSourceCodeLanguageKindObjectiveC:
327+
case DVTSourceCodeLanguageKindOthers:
328+
defaultAutocompletionRange = [textView.string rangeOfString:@"\\s*case <#constant#>:\\s*<#statements#>\\s*break;\\s*default:\\s*break;\\s*" options:NSRegularExpressionSearch range:NSMakeRange(openingBracketLocation, closingBracketLocation - openingBracketLocation)];
329+
break;
283330
}
284331

285332
if(defaultAutocompletionRange.location != NSNotFound) {
@@ -304,7 +351,7 @@ - (BOOL)tryExpandingSwitchStatement
304351
[replacementString appendString:@"\n"];
305352
} else {
306353
// keep Swift code compact
307-
if (![[SCXcodeSwitchExpander sharedSwitchExpander] isSwift]) {
354+
if (language != DVTSourceCodeLanguageKindSwift) {
308355
[replacementString appendString:@"\n"];
309356
}
310357
}
@@ -319,11 +366,19 @@ - (BOOL)tryExpandingSwitchStatement
319366
}
320367

321368
if([switchContent rangeOfString:child.displayName].location == NSNotFound) {
322-
if ([[SCXcodeSwitchExpander sharedSwitchExpander] isSwift]) {
323-
NSString *childDisplayName = [self correctEnumConstantIfFromCocoa:[NSString stringWithFormat:@"%@",symbol] symbolName:symbolName cocoaEnumName:child.displayName];
324-
[replacementString appendString:[NSString stringWithFormat:@"case .%@: \n<#statement#>\n", childDisplayName]];
325-
} else {
326-
[replacementString appendString:[NSString stringWithFormat:@"case %@: {\n<#statement#>\nbreak;\n}\n", child.displayName]];
369+
switch (language) {
370+
371+
case DVTSourceCodeLanguageKindSwift:
372+
{
373+
NSString *childDisplayName = [self correctEnumConstantIfFromCocoa:[NSString stringWithFormat:@"%@",symbol] symbolName:symbolName cocoaEnumName:child.displayName];
374+
[replacementString appendString:[NSString stringWithFormat:@"case .%@: \n<#statement#>\n", childDisplayName]];
375+
break;
376+
}
377+
378+
case DVTSourceCodeLanguageKindObjectiveC:
379+
case DVTSourceCodeLanguageKindOthers:
380+
[replacementString appendString:[NSString stringWithFormat:@"case %@: {\n<#statement#>\nbreak;\n}\n", child.displayName]];
381+
break;
327382
}
328383
}
329384
}

0 commit comments

Comments
 (0)