[Omit needless words] Strip context from "set" methods.

Fixes rdar://problem/25750367.
This commit is contained in:
Doug Gregor
2016-04-26 16:41:55 -07:00
parent 312aa06901
commit a82cc07ee0
3 changed files with 19 additions and 0 deletions

View File

@@ -1219,6 +1219,19 @@ bool swift::omitNeedlessWords(StringRef &baseName,
return lowercaseAcronymsForReturn();
}
if (camel_case::getFirstWord(baseName) == "set") {
StringRef newBaseName = ::omitNeedlessWords(
baseName,
contextType,
NameRole::Property,
allPropertyNames,
scratch);
if (newBaseName != baseName) {
baseName = newBaseName;
anyChanges = true;
}
}
// If needed, split the base name.
if (!argNames.empty() &&
splitBaseName(baseName, argNames[0], paramTypes[0], firstParamName))