mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Omit needless words] Stop moving "of" onto the base name.
The benefits from moving "of" onto the base name were outweighed by the complications to the API guidelines.
This commit is contained in:
@@ -895,18 +895,6 @@ static bool shouldPlacePrepositionOnArgLabel(StringRef beforePreposition,
|
||||
afterPreposition == "Z")
|
||||
return false;
|
||||
|
||||
// The preposition "of" binds tightly to the left word, except in
|
||||
// rare cases.
|
||||
if (camel_case::sameWordIgnoreFirstCase(preposition, "of")) {
|
||||
auto following = camel_case::getFirstWord(afterPreposition);
|
||||
if (!camel_case::sameWordIgnoreFirstCase(following, "type") &&
|
||||
!camel_case::sameWordIgnoreFirstCase(following, "types") &&
|
||||
!camel_case::sameWordIgnoreFirstCase(following, "kind") &&
|
||||
!camel_case::sameWordIgnoreFirstCase(following, "size") &&
|
||||
!camel_case::sameWordIgnoreFirstCase(following, "length"))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user