Skip to content

Commit 2c314a7

Browse files
erwinmazaerwin-CL
authored andcommitted
Remove check for parens around enum symbol for Swift
1 parent 6d8a8f5 commit 2c314a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

SCXcodeSwitchExpander/DVTTextCompletionController+SCXcodeSwitchExpander.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ - (BOOL)tryExpandingSwitchStatement
9898
}
9999

100100
// See if the current line has a switch statement
101-
NSRange switchRange = [textView.string rangeOfString:@"\\s+switch\\s*\\\(" options:NSRegularExpressionSearch range:NSMakeRange(newLineRange.location, self.session.wordStartLocation - newLineRange.location)];
101+
NSString *regPattern = [[SCXcodeSwitchExpander sharedSwitchExpander] isSwift] ? @"\\s+switch\\s*" : @"\\s+switch\\s*\\\(";
102+
NSRange switchRange = [textView.string rangeOfString:regPattern options:NSRegularExpressionSearch range:NSMakeRange(newLineRange.location, self.session.wordStartLocation - newLineRange.location)];
102103
if(switchRange.location == NSNotFound) {
103104
return NO;
104105
}

0 commit comments

Comments
 (0)