File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -838,6 +838,14 @@ class ObjcMethodReferenceCollector: public SourceEntityWalker {
838838 else
839839 return " method" ;
840840 }
841+ static StringRef selectMethodOwnerKey (const clang::NamedDecl* clangD) {
842+ assert (clangD);
843+ if (isa<clang::ObjCInterfaceDecl>(clangD))
844+ return " interface_type" ;
845+ if (isa<clang::ObjCCategoryDecl>(clangD))
846+ return " category_type" ;
847+ return " type" ;
848+ }
841849public:
842850 void setFileBeforeVisiting (SourceFile *SF) {
843851 assert (SF && " need to visit actual source files" );
@@ -857,7 +865,7 @@ class ObjcMethodReferenceCollector: public SourceEntityWalker {
857865 ->getParent ())) {
858866 auto pName = parent->getName ();
859867 if (!pName.empty ())
860- out.attribute (" type " , pName);
868+ out.attribute (selectMethodOwnerKey (parent) , pName);
861869 }
862870 out.attribute (selectMethodKey (clangD), clangD->getNameAsString ());
863871 out.attribute (" declared_at" , Loc.printToString (SM));
Original file line number Diff line number Diff line change @@ -16,6 +16,6 @@ public func testProperties(_ x: FooClassBase) {
1616// CHECK-DAG: "instance_method": "fooBaseInstanceFunc0"
1717// CHECK-DAG: "instance_method": "fooBaseInstanceFunc1:"
1818// CHECK-DAG: "class_method": "fooBaseClassFunc0"
19- // CHECK-DAG: "type ": "FooClassBase"
19+ // CHECK-DAG: "interface_type ": "FooClassBase"
2020// CHECK-DAG: "declared_at": "SOURCE_DIR/test/IDE/Inputs/mock-sdk/Foo.framework/Headers/Foo.h
2121// CHECK-DAG: "referenced_at": "SOURCE_DIR/test/IDE/objc_send_collector.swift"
You can’t perform that action at this time.
0 commit comments