swift-api-digester: detected getter/setter function to property updates should be explicit about the new property names instead of inferring them from old function name.

This commit is contained in:
Xi Ge
2017-06-12 14:52:38 -07:00
parent 94c00c4b6a
commit ce17eae939
5 changed files with 32 additions and 1 deletions

View File

@@ -1637,6 +1637,8 @@ class RemovedAddedNodeMatcher : public NodeMatcher, public MatchedNodeListener {
} else {
return false;
}
R->annotate(NodeAnnotation::PropertyName);
R->addAnnotateComment(NodeAnnotation::PropertyName, A->getPrintedName());
foundMatch(R, A);
return true;
}
@@ -1867,7 +1869,8 @@ class SameNameNodeMatcher : public NodeMatcher {
return FuncPriority;
} else {
static NameMatchKind OtherPriority[] = { NameMatchKind::PrintedNameAndUSR,
NameMatchKind::PrintedName };
NameMatchKind::PrintedName,
NameMatchKind::USR };
return OtherPriority;
}
}
@@ -2455,6 +2458,9 @@ class DiffItemEmitter : public SDKNodeVisitor {
return Node->getAnnotateComment(NodeAnnotation::ModernizeEnum);
case NodeAnnotation::Rename:
return Node->getAnnotateComment(NodeAnnotation::RenameNewName);
case NodeAnnotation::GetterToProperty:
case NodeAnnotation::SetterToProperty:
return Node->getAnnotateComment(NodeAnnotation::PropertyName);
default:
return StringRef();
}