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 {
829
829
}
830
830
return true ;
831
831
}
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
+ }
832
841
public:
833
842
void setFileBeforeVisiting (SourceFile *SF) {
834
843
assert (SF && " need to visit actual source files" );
@@ -850,7 +859,7 @@ class ObjcMethodReferenceCollector: public SourceEntityWalker {
850
859
if (!pName.empty ())
851
860
out.attribute (" type" , pName);
852
861
}
853
- out.attribute (" method " , clangD->getNameAsString ());
862
+ out.attribute (selectMethodKey (clangD) , clangD->getNameAsString ());
854
863
out.attribute (" declared_at" , Loc.printToString (SM));
855
864
out.attribute (" referenced_at" , visitingFilePath);
856
865
});
Original file line number Diff line number Diff line change @@ -10,10 +10,12 @@ import Foo
10
10
public func testProperties( _ x: FooClassBase ) {
11
11
_ = x. fooBaseInstanceFunc0 ( )
12
12
x. fooBaseInstanceFunc1 ( 1.2 )
13
+ _ = FooClassBase . fooBaseClassFunc0 ( )
13
14
}
14
15
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"
17
19
// CHECK-DAG: "type": "FooClassBase"
18
20
// CHECK-DAG: "declared_at": "SOURCE_DIR/test/IDE/Inputs/mock-sdk/Foo.framework/Headers/Foo.h
19
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