11// REQUIRES: objc_interop
22
3+ // TODO: Add some way to specify extra options to symbolgraph-extract and then
4+ // split this test into parts under the SymbolGraph directory. The SK
5+ // tests should just check that we run the generation on 1. the correct
6+ // symbol and 2. with the correct options.
7+
38// RUN: %empty-directory(%t)
49// RUN: split-file --leading-lines %s %t
510
@@ -10,6 +15,9 @@ func test(s: ObjCStruct) {
1015 // RUN: %sourcekitd-test -req=cursor -pos=%(line+1):3 -req-opts=retrieve_symbol_graph=1 %t/use.swift -- -I %t/mod -target %target-triple %t/use.swift | %FileCheck -check-prefix=CHECK-FUNC %s
1116 someFunc ( )
1217
18+ // RUN: %sourcekitd-test -req=cursor -pos=%(line+1):3 -req-opts=retrieve_symbol_graph=1 %t/use.swift -- -I %t/mod -target %target-triple %t/use.swift | %FileCheck -check-prefix=CHECK-DIRECTIVE-FUNC %s
19+ funcUnderDirective ( )
20+
1321 // RUN: %sourcekitd-test -req=cursor -pos=%(line+1):9 -req-opts=retrieve_symbol_graph=1 %t/use.swift -- -I %t/mod -target %target-triple %t/use.swift | %FileCheck -check-prefix=CHECK-NO %s
1422 _ = s. noDoc
1523
@@ -100,6 +108,9 @@ func test(s: ObjCStruct) {
100108// CHECK-FUNC: "displayName": "Function",
101109// CHECK-FUNC: "identifier": "swift.func"
102110// CHECK-FUNC: },
111+ // CHECK-FUNC: "location": {
112+ // CHECK-FUNC: "uri": "file://{{.*}}mod{{\\\\|/}}M.h"
113+ // CHECK-FUNC: },
103114// CHECK-FUNC: "names": {
104115// CHECK-FUNC: "subHeading": [
105116// CHECK-FUNC: {
@@ -266,3 +277,9 @@ struct ObjCStruct {
266277 // CHECK-MIXED-DOC-NEXT: ]
267278 // CHECK-MIXED-DOC-NEXT: }
268279} ;
280+
281+ #line 10 " other.h "
282+ void funcUnderDirective ( void) ;
283+ // CHECK-DIRECTIVE-FUNC: "location": {
284+ // CHECK-DIRECTIVE-FUNC: "uri": "file://{{.*}}other.h"
285+ // CHECK-DIRECTIVE-FUNC: }
0 commit comments