[SourceKit] DocInfo: Update the UIdent for synthesized extensions to respect the synthesized targets instead of the original extended types.

This commit is contained in:
Xi Ge
2016-03-31 18:11:14 -07:00
parent 7cb49d7f4b
commit 8afcf65fa2
5 changed files with 41 additions and 21 deletions

View File

@@ -277,6 +277,21 @@ UIdent SwiftLangSupport::getUIDForDecl(const Decl *D, bool IsRef) {
return UIdentVisitor(IsRef).visit(const_cast<Decl*>(D));
}
UIdent SwiftLangSupport::getUIDForExtensionOfDecl(const Decl *D) {
switch (D->getKind()) {
case swift::DeclKind::Struct:
return KindDeclExtensionStruct;
case swift::DeclKind::Enum:
return KindDeclExtensionEnum;
case swift::DeclKind::Class:
return KindDeclExtensionClass;
case swift::DeclKind::Protocol:
return KindDeclExtensionProtocol;
default:
llvm_unreachable("cannot have extension.");
}
}
UIdent SwiftLangSupport::getUIDForLocalVar(bool IsRef) {
return IsRef ? KindRefVarLocal : KindDeclVarLocal;
}