1
1
// REQUIRES: objc_interop
2
2
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
+
3
8
// RUN: %empty-directory(%t)
4
9
// RUN: split-file --leading-lines %s %t
5
10
@@ -10,6 +15,9 @@ func test(s: ObjCStruct) {
10
15
// 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
11
16
someFunc ( )
12
17
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
+
13
21
// 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
14
22
_ = s. noDoc
15
23
@@ -100,6 +108,9 @@ func test(s: ObjCStruct) {
100
108
// CHECK-FUNC: "displayName": "Function",
101
109
// CHECK-FUNC: "identifier": "swift.func"
102
110
// CHECK-FUNC: },
111
+ // CHECK-FUNC: "location": {
112
+ // CHECK-FUNC: "uri": "file://{{.*}}mod{{\\\\|/}}M.h"
113
+ // CHECK-FUNC: },
103
114
// CHECK-FUNC: "names": {
104
115
// CHECK-FUNC: "subHeading": [
105
116
// CHECK-FUNC: {
@@ -266,3 +277,9 @@ struct ObjCStruct {
266
277
// CHECK-MIXED-DOC-NEXT: ]
267
278
// CHECK-MIXED-DOC-NEXT: }
268
279
} ;
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