Skip to content

Commit 5b46c69

Browse files
committed
Addresses one of the problems from #19
1 parent 6bdd733 commit 5b46c69

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

SCXcodeSwitchExpander.xcodeproj/project.pbxproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
18990B1718D25239007A8756 /* Project object */ = {
156156
isa = PBXProject;
157157
attributes = {
158-
LastUpgradeCheck = 0510;
158+
LastUpgradeCheck = 0700;
159159
ORGANIZATIONNAME = "Stefan Ceriu";
160160
};
161161
buildConfigurationList = 18990B1A18D25239007A8756 /* Build configuration list for PBXProject "SCXcodeSwitchExpander" */;
@@ -215,6 +215,7 @@
215215
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
216216
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
217217
COPY_PHASE_STRIP = NO;
218+
ENABLE_TESTABILITY = YES;
218219
GCC_C_LANGUAGE_STANDARD = gnu99;
219220
GCC_DYNAMIC_NO_PIC = NO;
220221
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -285,6 +286,7 @@
285286
GCC_PREFIX_HEADER = "SCXcodeSwitchExpander/SCXcodeSwitchExpander-Prefix.pch";
286287
INFOPLIST_FILE = "SCXcodeSwitchExpander/SCXcodeSwitchExpander-Info.plist";
287288
INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins";
289+
PRODUCT_BUNDLE_IDENTIFIER = "com.stefanceriu.${PRODUCT_NAME:rfc1034identifier}";
288290
PRODUCT_NAME = "$(TARGET_NAME)";
289291
WRAPPER_EXTENSION = xcplugin;
290292
};
@@ -307,6 +309,7 @@
307309
GCC_PREFIX_HEADER = "SCXcodeSwitchExpander/SCXcodeSwitchExpander-Prefix.pch";
308310
INFOPLIST_FILE = "SCXcodeSwitchExpander/SCXcodeSwitchExpander-Info.plist";
309311
INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins";
312+
PRODUCT_BUNDLE_IDENTIFIER = "com.stefanceriu.${PRODUCT_NAME:rfc1034identifier}";
310313
PRODUCT_NAME = "$(TARGET_NAME)";
311314
WRAPPER_EXTENSION = xcplugin;
312315
};

SCXcodeSwitchExpander/DVTTextCompletionController+SCXcodeSwitchExpander.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ - (BOOL)tryExpandingSwitchStatement
109109
return NO;
110110
}
111111

112+
// Check if it's the opening bracket for the switch statement or something else
113+
NSString *remainingText = [textView.string substringWithRange:NSMakeRange(switchRange.location + switchRange.length, openingBracketLocation - switchRange.location - switchRange.length)];
114+
if([remainingText rangeOfString:@"}"].location != NSNotFound) {
115+
return NO;
116+
}
117+
112118
// Insert the selected autocomplete item
113119
[self.session insertCurrentCompletion];
114120

SCXcodeSwitchExpander/SCXcodeSwitchExpander-Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<key>CFBundleIconFile</key>
1010
<string></string>
1111
<key>CFBundleIdentifier</key>
12-
<string>com.stefanceriu.${PRODUCT_NAME:rfc1034identifier}</string>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
1414
<string>6.0</string>
1515
<key>CFBundleName</key>
@@ -39,7 +39,7 @@
3939
<string>8DC44374-2B35-4C57-A6FE-2AD66A36AAD9</string>
4040
<string>7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90</string>
4141
<string>AABB7188-E14E-4433-AD3B-5CD791EAD9A3</string>
42-
<string>0420B86A-AA43-4792-9ED0-6FE0F2B16A13</string>
42+
<string>0420B86A-AA43-4792-9ED0-6FE0F2B16A13</string>
4343
<string>CC0D0F4F-05B3-431A-8F33-F84AFCB2C651</string>
4444
</array>
4545
<key>NSHumanReadableCopyright</key>

0 commit comments

Comments
 (0)