Skip to content

Commit 1d39707

Browse files
committed
[Omit needless words] Don't split "PlugIn".
Fixes rdar://problem/26334014.
1 parent 2807a17 commit 1d39707

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

lib/Basic/StringExtras.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,10 @@ camel_case::toLowercaseInitialisms(StringRef string,
886886
/// splitting.
887887
static bool wordConflictsBeforePreposition(StringRef word,
888888
StringRef preposition) {
889+
if (camel_case::sameWordIgnoreFirstCase(preposition, "in") &&
890+
camel_case::sameWordIgnoreFirstCase(word, "plug"))
891+
return true;
892+
889893
return false;
890894
}
891895

test/IDE/Inputs/custom-modules/OmitNeedlessWords.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
-(void)doSomethingSeparatedBy:(NSInteger)value;
3535
+(nonnull OmitNeedlessWords *)currentOmitNeedlessWords;
3636
+(void)setCurrentOmitNeedlessWords:(nonnull OmitNeedlessWords *)value;
37+
-(void)compilerPlugInValue:(NSInteger)value;
3738
@end
3839

3940
@interface ABCDoodle : NSObject

test/IDE/print_omit_needless_words.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@
308308
// CHECK-OMIT-NEEDLESS-WORDS: class func current() -> OmitNeedlessWords
309309
// CHECK-OMIT-NEEDLESS-WORDS: class func setCurrent(_: OmitNeedlessWords)
310310

311+
// Don't split "PlugIn".
312+
// CHECK-OMIT-NEEDLESS-WORDS: func compilerPlugInValue(_: Int)
313+
311314
// Property-name sensitivity in the base name "Self" stripping.
312315
// CHECK-OMIT-NEEDLESS-WORDS: func addDoodle(_: ABCDoodle)
313316

0 commit comments

Comments
 (0)