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 {
838
838
else
839
839
return " method" ;
840
840
}
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
+ }
841
849
public:
842
850
void setFileBeforeVisiting (SourceFile *SF) {
843
851
assert (SF && " need to visit actual source files" );
@@ -857,7 +865,7 @@ class ObjcMethodReferenceCollector: public SourceEntityWalker {
857
865
->getParent ())) {
858
866
auto pName = parent->getName ();
859
867
if (!pName.empty ())
860
- out.attribute (" type " , pName);
868
+ out.attribute (selectMethodOwnerKey (parent) , pName);
861
869
}
862
870
out.attribute (selectMethodKey (clangD), clangD->getNameAsString ());
863
871
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) {
16
16
// CHECK-DAG: "instance_method": "fooBaseInstanceFunc0"
17
17
// CHECK-DAG: "instance_method": "fooBaseInstanceFunc1:"
18
18
// CHECK-DAG: "class_method": "fooBaseClassFunc0"
19
- // CHECK-DAG: "type ": "FooClassBase"
19
+ // CHECK-DAG: "interface_type ": "FooClassBase"
20
20
// CHECK-DAG: "declared_at": "SOURCE_DIR/test/IDE/Inputs/mock-sdk/Foo.framework/Headers/Foo.h
21
21
// CHECK-DAG: "referenced_at": "SOURCE_DIR/test/IDE/objc_send_collector.swift"
You can’t perform that action at this time.
0 commit comments