Skip to content

Commit ba39c7b

Browse files
marcelofabrinkcsgexi
authored andcommitted
[SourceKit] Include AccessLevel attributes in structure (SR-5978) (swiftlang#12086)
1 parent da98178 commit ba39c7b

14 files changed

+1624
-135
lines changed

test/SourceKit/DocumentStructure/access_parse.swift.response

Lines changed: 312 additions & 31 deletions
Large diffs are not rendered by default.

test/SourceKit/Indexing/index_constructors.swift.response

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
key.column: 21,
6565
key.is_dynamic: 1,
6666
key.attributes: [
67+
{
68+
key.attribute: source.decl.attribute.public
69+
},
6770
{
6871
key.attribute: source.decl.attribute.objc
6972
}

test/SourceKit/Indexing/index_enum_case.swift.response

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@
9393
key.line: 8,
9494
key.column: 15
9595
}
96+
],
97+
key.attributes: [
98+
{
99+
key.attribute: source.decl.attribute.public
100+
}
96101
]
97102
},
98103
{

test/SourceKit/Indexing/index_is_test_candidate.swift.response

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@
104104
]
105105
}
106106
],
107+
key.attributes: [
108+
{
109+
key.attribute: source.decl.attribute.private
110+
}
111+
],
107112
key.is_test_candidate: 1
108113
},
109114
{
@@ -177,7 +182,12 @@
177182
key.usr: "s:23index_is_test_candidate7MyClassC0C57_startsWithTest_takesNoParams_andReturnsVoid_butIsPrivate33_E06F4E7BC5F577AB6E2EC6D3ECA1C8B9LLyyF",
178183
key.line: 24,
179184
key.column: 16,
180-
key.is_dynamic: 1
185+
key.is_dynamic: 1,
186+
key.attributes: [
187+
{
188+
key.attribute: source.decl.attribute.private
189+
}
190+
]
181191
},
182192
{
183193
key.kind: source.lang.swift.decl.function.method.instance,
@@ -216,6 +226,11 @@
216226
]
217227
}
218228
],
229+
key.attributes: [
230+
{
231+
key.attribute: source.decl.attribute.public
232+
}
233+
],
219234
key.is_test_candidate: 1
220235
}
221236
]

test/SourceKit/Indexing/index_is_test_candidate_objc.swift.response

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@
105105
]
106106
}
107107
],
108+
key.attributes: [
109+
{
110+
key.attribute: source.decl.attribute.private
111+
}
112+
],
108113
key.is_test_candidate: 1
109114
},
110115
{
@@ -179,6 +184,11 @@
179184
key.line: 23,
180185
key.column: 16,
181186
key.is_dynamic: 1,
187+
key.attributes: [
188+
{
189+
key.attribute: source.decl.attribute.private
190+
}
191+
],
182192
key.is_test_candidate: 1
183193
},
184194
{
@@ -218,6 +228,11 @@
218228
]
219229
}
220230
],
231+
key.attributes: [
232+
{
233+
key.attribute: source.decl.attribute.public
234+
}
235+
],
221236
key.is_test_candidate: 1
222237
}
223238
]

test/SourceKit/InterfaceGen/gen_clang_module.swift.helper.explicit.response

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ public func fooHelperExplicitFrameworkFunc1(_ a: Int32) -> Int32
6262
key.typename: "Int32",
6363
key.nameoffset: 13,
6464
key.namelength: 43,
65+
key.attributes: [
66+
{
67+
key.offset: 1,
68+
key.length: 6,
69+
key.attribute: source.decl.attribute.public
70+
}
71+
],
6572
key.substructure: [
6673
{
6774
key.kind: source.lang.swift.decl.var.parameter,

test/SourceKit/InterfaceGen/gen_clang_module.swift.helper.response

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ public var FooHelperUnnamedEnumeratorA2: Int { get }
180180
key.typename: "Int32",
181181
key.nameoffset: 79,
182182
key.namelength: 26,
183+
key.attributes: [
184+
{
185+
key.offset: 67,
186+
key.length: 6,
187+
key.attribute: source.decl.attribute.public
188+
}
189+
],
183190
key.substructure: [
184191
{
185192
key.kind: source.lang.swift.decl.var.parameter,
@@ -201,7 +208,14 @@ public var FooHelperUnnamedEnumeratorA2: Int { get }
201208
key.length: 45,
202209
key.typename: "Int",
203210
key.nameoffset: 127,
204-
key.namelength: 28
211+
key.namelength: 28,
212+
key.attributes: [
213+
{
214+
key.offset: 116,
215+
key.length: 6,
216+
key.attribute: source.decl.attribute.public
217+
}
218+
]
205219
},
206220
{
207221
key.kind: source.lang.swift.decl.var.global,
@@ -212,6 +226,13 @@ public var FooHelperUnnamedEnumeratorA2: Int { get }
212226
key.length: 45,
213227
key.typename: "Int",
214228
key.nameoffset: 180,
215-
key.namelength: 28
229+
key.namelength: 28,
230+
key.attributes: [
231+
{
232+
key.offset: 169,
233+
key.length: 6,
234+
key.attribute: source.decl.attribute.public
235+
}
236+
]
216237
}
217238
]

0 commit comments

Comments
 (0)