@@ -62,78 +62,92 @@ extension Parent.Inner.DeepNested<T> where T: Equatable {
62
62
}
63
63
}
64
64
65
- // 1) Global symbols have no parents, but do have a symbol graph .
65
+ // 1) Global symbols should include only themselves .
66
66
//
67
- // RUN: %sourcekitd-test -req=cursor -pos=2:5 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =GLOBAL %s
68
- // RUN: %sourcekitd-test -req=cursor -pos=5:8 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =GLOBAL %s
69
- // RUN: %sourcekitd-test -req=cursor -pos=27:11 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =GLOBAL %s
70
- // RUN: %sourcekitd-test -req=cursor -pos=39:11 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =GLOBAL %s
71
- // RUN: %sourcekitd-test -req=cursor -pos=50:11 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =GLOBAL %s
67
+ // RUN: %sourcekitd-test -req=cursor -pos=2:5 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =GLOBAL,GLOBAL_VAR %s
68
+ // RUN: %sourcekitd-test -req=cursor -pos=5:8 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =GLOBAL,PARENT_STRUCT %s
69
+ // RUN: %sourcekitd-test -req=cursor -pos=27:11 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =GLOBAL,PARENT_STRUCT %s
70
+ // RUN: %sourcekitd-test -req=cursor -pos=39:11 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =GLOBAL,PARENT_STRUCT %s
71
+ // RUN: %sourcekitd-test -req=cursor -pos=50:11 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =GLOBAL,PARENT_STRUCT %s
72
72
//
73
73
//
74
- // GLOBAL-NOT: PARENT CONTEXTS BEGIN
75
74
// GLOBAL: SYMBOL GRAPH BEGIN
76
- // GLOBAL-NOT: PARENT CONTEXTS BEGIN
75
+ // GLOBAL: PARENT CONTEXTS BEGIN
76
+ // GLOBAL_VAR-NEXT: global swift.var s:27cursor_symbol_graph_parents6globalSivp
77
+ // PARENT_STRUCT-NEXT: Parent swift.struct s:27cursor_symbol_graph_parents6ParentV
78
+ // GLOBAL-NEXT: PARENT CONTEXTS END
77
79
78
80
79
- // 2) Members within Parent and its extensions should list Parent as a parent
80
- // context, and have a symbol graph .
81
+ // 2) Members within Parent and its extensions should list themselves and
82
+ // Parent .
81
83
//
82
- // RUN: %sourcekitd-test -req=cursor -pos=7:12 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =PARENTMEMBER %s
83
- // RUN: %sourcekitd-test -req=cursor -pos=13:9 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =PARENTMEMBER %s
84
- // RUN: %sourcekitd-test -req=cursor -pos=15:10 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =PARENTMEMBER %s
85
- // RUN: %sourcekitd-test -req=cursor -pos=29:10 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =PARENTMEMBER %s
86
- // RUN: %sourcekitd-test -req=cursor -pos=32:12 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =PARENTMEMBER %s
87
- // RUN: %sourcekitd-test -req=cursor -pos=39:18 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =PARENTMEMBER %s
88
- // RUN: %sourcekitd-test -req=cursor -pos=50:18 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =PARENTMEMBER %s
84
+ // RUN: %sourcekitd-test -req=cursor -pos=7:12 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =PARENTMEMBER,INNER_STRUCT %s
85
+ // RUN: %sourcekitd-test -req=cursor -pos=13:9 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =PARENTMEMBER,MEMBER_VAR %s
86
+ // RUN: %sourcekitd-test -req=cursor -pos=15:10 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =PARENTMEMBER,METHOD_FUNC %s
87
+ // RUN: %sourcekitd-test -req=cursor -pos=29:10 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =PARENTMEMBER,EXTMETHOD_FUNC %s
88
+ // RUN: %sourcekitd-test -req=cursor -pos=32:12 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =PARENTMEMBER,EXTINNER_STRUCT %s
89
+ // RUN: %sourcekitd-test -req=cursor -pos=39:18 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =PARENTMEMBER,INNER_STRUCT %s
90
+ // RUN: %sourcekitd-test -req=cursor -pos=50:18 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =PARENTMEMBER,INNER_STRUCT %s
89
91
//
90
92
//
91
93
// PARENTMEMBER: SYMBOL GRAPH BEGIN
92
94
// PARENTMEMBER: SYMBOL GRAPH END
93
95
// PARENTMEMBER: PARENT CONTEXTS BEGIN
94
96
// PARENTMEMBER-NEXT: Parent swift.struct s:27cursor_symbol_graph_parents6ParentV
97
+ // INNER_STRUCT-NEXT: Inner swift.struct s:27cursor_symbol_graph_parents6ParentV5InnerV
98
+ // MEMBER_VAR-NEXT: member swift.property s:27cursor_symbol_graph_parents6ParentV6memberSivp
99
+ // METHOD_FUNC-NEXT: method() swift.method s:27cursor_symbol_graph_parents6ParentV6methodyyF
100
+ // EXTMETHOD_FUNC-NEXT: extensionMethod() swift.method s:27cursor_symbol_graph_parents6ParentV15extensionMethodyyF
101
+ // EXTINNER_STRUCT-NEXT: ExtInner swift.struct s:27cursor_symbol_graph_parents6ParentV8ExtInnerV
95
102
// PARENTMEMBER-NEXT: PARENT CONTEXTS END
96
103
97
104
98
- // 3) Members within Parent.Inner and its extensions should list both Inner and
99
- // Parent as parent contexts, and have a symbol graph .
105
+ // 3) Members within Parent.Inner and its extensions should list themselves,
106
+ // Inner and Parent as parent contexts.
100
107
//
101
- // RUN: %sourcekitd-test -req=cursor -pos=9:13 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =INNERMEMBER %s
102
- // RUN: %sourcekitd-test -req=cursor -pos=41:10 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =INNERMEMBER %s
103
- // RUN: %sourcekitd-test -req=cursor -pos=43:12 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =INNERMEMBER %s
104
- // RUN: %sourcekitd-test -req=cursor -pos=50:24 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =INNERMEMBER %s
108
+ // RUN: %sourcekitd-test -req=cursor -pos=9:13 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =INNERMEMBER,INNERMEMBER_VAR %s
109
+ // RUN: %sourcekitd-test -req=cursor -pos=41:10 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =INNERMEMBER,EXTINNERMETHOD_FUNC %s
110
+ // RUN: %sourcekitd-test -req=cursor -pos=43:12 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =INNERMEMBER,DEEPNESTED_CLASS %s
111
+ // RUN: %sourcekitd-test -req=cursor -pos=50:24 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =INNERMEMBER,DEEPNESTED_CLASS %s
105
112
//
106
113
// INNERMEMBER: SYMBOL GRAPH BEGIN
107
114
// INNERMEMBER: SYMBOL GRAPH END
108
115
// INNERMEMBER: PARENT CONTEXTS BEGIN
109
116
// INNERMEMBER-NEXT: Parent swift.struct s:27cursor_symbol_graph_parents6ParentV
110
117
// INNERMEMBER-NEXT: Inner swift.struct s:27cursor_symbol_graph_parents6ParentV5InnerV
118
+ // INNERMEMBER_VAR-NEXT: innerMember swift.property s:27cursor_symbol_graph_parents6ParentV5InnerV11innerMemberSivp
119
+ // EXTINNERMETHOD_FUNC-NEXT: extensionOfInnerMethod() swift.method s:27cursor_symbol_graph_parents6ParentV5InnerV011extensionOfF6MethodyyF
120
+ // DEEPNESTED_CLASS-NEXT: DeepNested swift.class s:27cursor_symbol_graph_parents6ParentV5InnerV10DeepNestedC
111
121
// INNERMEMBER-NEXT: PARENT CONTEXTS END
112
122
113
123
114
124
// 4) Members within Parent.Inner.DeepNested and its extensions should list
115
- // DeepNested, Inner, and Parent as parent contexts and have a symbol graph .
125
+ // themselves DeepNested, Inner, and Parent.
116
126
//
117
- // RUN: %sourcekitd-test -req=cursor -pos=45:9 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =DEEPNESTEDMEMBER %s
118
- // RUN: %sourcekitd-test -req=cursor -pos=52:10 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix =DEEPNESTEDMEMBER %s
127
+ // RUN: %sourcekitd-test -req=cursor -pos=45:9 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =DEEPNESTEDMEMBER,DEEPNESTED_INIT %s
128
+ // RUN: %sourcekitd-test -req=cursor -pos=52:10 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefixes =DEEPNESTEDMEMBER,EXTDEEPNESTEDMETHOD_FUNC %s
119
129
//
120
130
// DEEPNESTEDMEMBER: SYMBOL GRAPH BEGIN
121
131
// DEEPNESTEDMEMBER: SYMBOL GRAPH END
122
132
// DEEPNESTEDMEMBER: PARENT CONTEXTS BEGIN
123
133
// DEEPNESTEDMEMBER-NEXT: Parent swift.struct s:27cursor_symbol_graph_parents6ParentV
124
134
// DEEPNESTEDMEMBER-NEXT: Inner swift.struct s:27cursor_symbol_graph_parents6ParentV5InnerV
125
135
// DEEPNESTEDMEMBER-NEXT: DeepNested swift.class s:27cursor_symbol_graph_parents6ParentV5InnerV10DeepNestedC
136
+ // DEEPNESTED_INIT-NEXT: init(deepNestedInit:) swift.init s:27cursor_symbol_graph_parents6ParentV5InnerV10DeepNestedC04deepH4InitAGy__xGx_tcfc
137
+ // EXTDEEPNESTEDMETHOD_FUNC: extensionOfDeepNestedMethod() swift.method s:27cursor_symbol_graph_parents6ParentV5InnerV10DeepNestedCAASQRzlE011extensionOfgH6MethodyyF
126
138
// DEEPNESTEDMEMBER-NEXT: PARENT
127
139
128
140
129
- // 5) Members directly or indirectly within local contexts should show the
130
- // local contexts as parents if they're representable in the symbol graph.
141
+ // 5) Members directly or indirectly within local contexts should show
142
+ // themselves and the local contexts as parents if they're representable in
143
+ // the symbol graph.
131
144
//
132
145
// RUN: %sourcekitd-test -req=cursor -pos=19:16 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix=LOCAL %s
133
146
//
134
147
// LOCAL: PARENT CONTEXTS BEGIN
135
148
// LOCAL-NEXT: Parent swift.struct s:27cursor_symbol_graph_parents6ParentV
136
149
// LOCAL-NEXT: localContext() swift.method s:27cursor_symbol_graph_parents6ParentV12localContextyyF
150
+ // LOCAL-NEXT: Local swift.struct s:27cursor_symbol_graph_parents6ParentV12localContextyyF5LocalL_V
137
151
// LOCAL-NEXT: PARENT CONTEXTS END
138
152
//
139
153
// RUN: %sourcekitd-test -req=cursor -pos=21:17 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix=TRANSITIVELOCAL %s
@@ -142,6 +156,7 @@ extension Parent.Inner.DeepNested<T> where T: Equatable {
142
156
// TRANSITIVELOCAL-NEXT: Parent swift.struct s:27cursor_symbol_graph_parents6ParentV
143
157
// TRANSITIVELOCAL-NEXT: localContext() swift.method s:27cursor_symbol_graph_parents6ParentV12localContextyyF
144
158
// TRANSITIVELOCAL-NEXT: Local swift.struct s:27cursor_symbol_graph_parents6ParentV12localContextyyF5LocalL_V
159
+ // TRANSITIVELOCAL-NEXT: localMember swift.property s:27cursor_symbol_graph_parents6ParentV12localContextyyF5LocalL_V0F6MemberSivp
145
160
// TRANSITIVELOCAL-NEXT: PARENT CONTEXTS END
146
161
//
147
162
// RUN: %sourcekitd-test -req=cursor -pos=56:20 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix=CLOSUREINLOCAL %s
@@ -160,6 +175,7 @@ extension Parent.Inner.DeepNested<T> where T: Equatable {
160
175
// CLOSUREINLOCAL-NEXT: Inner swift.struct s:27cursor_symbol_graph_parents6ParentV5InnerV
161
176
// CLOSUREINLOCAL-NEXT: DeepNested swift.class s:27cursor_symbol_graph_parents6ParentV5InnerV10DeepNestedC
162
177
// CLOSUREINLOCAL-NEXT: extensionOfDeepNestedMethod() swift.method s:27cursor_symbol_graph_parents6ParentV5InnerV10DeepNestedCAASQRzlE011extensionOfgH6MethodyyF
178
+ // CLOSUREINLOCAL-NEXT: InClosure swift.struct s:27cursor_symbol_graph_parents6ParentV5InnerV10DeepNestedCAASQRzlE011extensionOfgH6MethodyyFyycfU_9InClosureL_V
163
179
// CLOSUREINLOCAL-NEXT: PARENT CONTEXTS END
164
180
//
165
181
// RUN: %sourcekitd-test -req=cursor -pos=60:20 -req-opts=retrieve_symbol_graph=1 %s -- %s -target %target-triple | %FileCheck -check-prefix=ACCESSORINLOCAL %s
@@ -177,4 +193,5 @@ extension Parent.Inner.DeepNested<T> where T: Equatable {
177
193
// ACCESSORINLOCAL-NEXT: Inner swift.struct s:27cursor_symbol_graph_parents6ParentV5InnerV
178
194
// ACCESSORINLOCAL-NEXT: DeepNested swift.class s:27cursor_symbol_graph_parents6ParentV5InnerV10DeepNestedC
179
195
// ACCESSORINLOCAL-NEXT: extensionOfDeepNestedMethod() swift.method s:27cursor_symbol_graph_parents6ParentV5InnerV10DeepNestedCAASQRzlE011extensionOfgH6MethodyyF
196
+ // ACCESSORINLOCAL-NEXT: InAccessor swift.struct s:27cursor_symbol_graph_parents6ParentV5InnerV10DeepNestedCAASQRzlE011extensionOfgH6MethodyyF04deepH8ComputedL_Sivg10InAccessorL_V
180
197
// ACCESSORINLOCAL-NEXT: PARENT CONTEXTS END
0 commit comments