File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -829,6 +829,15 @@ class ObjcMethodReferenceCollector: public SourceEntityWalker {
829829 }
830830 return true ;
831831 }
832+ static StringRef selectMethodKey (const clang::ObjCMethodDecl* clangD) {
833+ assert (clangD);
834+ if (clangD->isInstanceMethod ())
835+ return " instance_method" ;
836+ else if (clangD->isClassMethod ())
837+ return " class_method" ;
838+ else
839+ return " method" ;
840+ }
832841public:
833842 void setFileBeforeVisiting (SourceFile *SF) {
834843 assert (SF && " need to visit actual source files" );
@@ -850,7 +859,7 @@ class ObjcMethodReferenceCollector: public SourceEntityWalker {
850859 if (!pName.empty ())
851860 out.attribute (" type" , pName);
852861 }
853- out.attribute (" method " , clangD->getNameAsString ());
862+ out.attribute (selectMethodKey (clangD) , clangD->getNameAsString ());
854863 out.attribute (" declared_at" , Loc.printToString (SM));
855864 out.attribute (" referenced_at" , visitingFilePath);
856865 });
Original file line number Diff line number Diff line change @@ -10,10 +10,12 @@ import Foo
1010public func testProperties( _ x: FooClassBase ) {
1111 _ = x. fooBaseInstanceFunc0 ( )
1212 x. fooBaseInstanceFunc1 ( 1.2 )
13+ _ = FooClassBase . fooBaseClassFunc0 ( )
1314}
1415
15- // CHECK-DAG: fooBaseInstanceFunc0
16- // CHECK-DAG: fooBaseInstanceFunc1
16+ // CHECK-DAG: "instance_method": "fooBaseInstanceFunc0"
17+ // CHECK-DAG: "instance_method": "fooBaseInstanceFunc1:"
18+ // CHECK-DAG: "class_method": "fooBaseClassFunc0"
1719// CHECK-DAG: "type": "FooClassBase"
1820// CHECK-DAG: "declared_at": "SOURCE_DIR/test/IDE/Inputs/mock-sdk/Foo.framework/Headers/Foo.h
1921// CHECK-DAG: "referenced_at": "SOURCE_DIR/test/IDE/objc_send_collector.swift"
You can’t perform that action at this time.
0 commit comments