[clang][ExtractAPI] Ensure that class properties have a kind of "Type Property"

Generated symbol graphs should distinguish between type properties and instance
properties.

Differential Revision: https://reviews.llvm.org/D130581
This commit is contained in:
Daniel Grumberg
2022-07-14 13:53:50 +01:00
parent 7f0387de4c
commit d3fc779e42
2 changed files with 753 additions and 3 deletions

View File

@@ -351,7 +351,7 @@ Object serializeSymbolKind(const APIRecord &Record, Language Lang) {
Kind["displayName"] = "Instance Variable";
break;
case APIRecord::RK_ObjCMethod:
if (dyn_cast<ObjCMethodRecord>(&Record)->IsInstanceMethod) {
if (cast<ObjCMethodRecord>(&Record)->IsInstanceMethod) {
Kind["identifier"] = AddLangPrefix("method");
Kind["displayName"] = "Instance Method";
} else {
@@ -360,8 +360,13 @@ Object serializeSymbolKind(const APIRecord &Record, Language Lang) {
}
break;
case APIRecord::RK_ObjCProperty:
Kind["identifier"] = AddLangPrefix("property");
Kind["displayName"] = "Instance Property";
if (cast<ObjCPropertyRecord>(&Record)->isClassProperty()) {
Kind["identifier"] = AddLangPrefix("type.property");
Kind["displayName"] = "Type Property";
} else {
Kind["identifier"] = AddLangPrefix("property");
Kind["displayName"] = "Instance Property";
}
break;
case APIRecord::RK_ObjCInterface:
Kind["identifier"] = AddLangPrefix("class");