Skip to content

Commit c18c7a6

Browse files
authored
Merge pull request #72003 from ahoppen/ahoppen/print-compilerargs-last
[SourceKit] Print compilerargs and sourcetext keys last
2 parents ecbe758 + 7ce4125 commit c18c7a6

32 files changed

+246
-238
lines changed

test/SourceKit/CodeComplete/complete_annotateddescription.swift.result

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,84 +3,84 @@
33
{
44
key.kind: source.lang.swift.decl.function.subscript,
55
key.name: "[:]",
6-
key.sourcetext: "[<#T##param: Int##Int#>]",
76
key.description: "[<callarg><callarg.label>_</callarg.label> <callarg.param>param</callarg.param>: <callarg.type><typeid.sys>Int</typeid.sys></callarg.type></callarg>]",
87
key.typename: "<typeid.sys>Int</typeid.sys>",
98
key.context: source.codecompletion.context.thisclass,
109
key.typerelation: source.codecompletion.typerelation.unknown,
1110
key.num_bytes_to_erase: 0,
1211
key.associated_usrs: "s:29complete_annotateddescription8MyStructVyS2icip",
13-
key.modulename: "complete_annotateddescription"
12+
key.modulename: "complete_annotateddescription",
13+
key.sourcetext: "[<#T##param: Int##Int#>]"
1414
},
1515
{
1616
key.kind: source.lang.swift.decl.function.subscript,
1717
key.name: "[label:]",
18-
key.sourcetext: "[label: <#T##Int#>]",
1918
key.description: "[<callarg><callarg.label>label</callarg.label> <callarg.param>param</callarg.param>: <callarg.type><typeid.sys>Int</typeid.sys></callarg.type></callarg>]",
2019
key.typename: "<typeid.sys>Int</typeid.sys>",
2120
key.context: source.codecompletion.context.thisclass,
2221
key.typerelation: source.codecompletion.typerelation.unknown,
2322
key.num_bytes_to_erase: 0,
2423
key.associated_usrs: "s:29complete_annotateddescription8MyStructV5labelS2i_tcip",
25-
key.modulename: "complete_annotateddescription"
24+
key.modulename: "complete_annotateddescription",
25+
key.sourcetext: "[label: <#T##Int#>]"
2626
},
2727
{
2828
key.kind: source.lang.swift.decl.function.method.instance,
2929
key.name: "labelName(label:)",
30-
key.sourcetext: ".labelName(label: <#T##(@autoclosure () -> Int) -> Int#>)",
3130
key.description: "<name>labelName</name>(<callarg><callarg.label>label</callarg.label>: <callarg.type>(<attribute>@autoclosure</attribute> () -&gt; <typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Int</typeid.sys></callarg.type></callarg>)",
3231
key.typename: "<typeid.sys>Void</typeid.sys>",
3332
key.context: source.codecompletion.context.thisclass,
3433
key.typerelation: source.codecompletion.typerelation.unknown,
3534
key.num_bytes_to_erase: 0,
3635
key.associated_usrs: "s:29complete_annotateddescription8MyStructV9labelName0E0yS2iyXKXE_tF",
37-
key.modulename: "complete_annotateddescription"
36+
key.modulename: "complete_annotateddescription",
37+
key.sourcetext: ".labelName(label: <#T##(@autoclosure () -> Int) -> Int#>)"
3838
},
3939
{
4040
key.kind: source.lang.swift.decl.function.method.instance,
4141
key.name: "labelNameParamName(label:)",
42-
key.sourcetext: ".labelNameParamName(label: <#T##(inout Int) throws -> MyStruct#>)",
4342
key.description: "<name>labelNameParamName</name>(<callarg><callarg.label>label</callarg.label> <callarg.param>param</callarg.param>: <callarg.type>(<keyword>inout</keyword> <typeid.sys>Int</typeid.sys>) <keyword>throws</keyword> -&gt; <typeid.user>MyStruct</typeid.user></callarg.type></callarg>) <keyword>rethrows</keyword>",
4443
key.typename: "<typeid.sys>Void</typeid.sys>",
4544
key.context: source.codecompletion.context.thisclass,
4645
key.typerelation: source.codecompletion.typerelation.unknown,
4746
key.num_bytes_to_erase: 0,
4847
key.associated_usrs: "s:29complete_annotateddescription8MyStructV014labelNameParamF00E0yACSizKXE_tKF",
49-
key.modulename: "complete_annotateddescription"
48+
key.modulename: "complete_annotateddescription",
49+
key.sourcetext: ".labelNameParamName(label: <#T##(inout Int) throws -> MyStruct#>)"
5050
},
5151
{
5252
key.kind: source.lang.swift.decl.function.method.instance,
5353
key.name: "paramName(:)",
54-
key.sourcetext: ".paramName(<#T##param: Int##Int#>)",
5554
key.description: "<name>paramName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>param</callarg.param>: <callarg.type><typeid.sys>Int</typeid.sys></callarg.type></callarg>)",
5655
key.typename: "<typeid.sys>Void</typeid.sys>",
5756
key.context: source.codecompletion.context.thisclass,
5857
key.typerelation: source.codecompletion.typerelation.unknown,
5958
key.num_bytes_to_erase: 0,
6059
key.associated_usrs: "s:29complete_annotateddescription8MyStructV9paramNameyySiF",
61-
key.modulename: "complete_annotateddescription"
60+
key.modulename: "complete_annotateddescription",
61+
key.sourcetext: ".paramName(<#T##param: Int##Int#>)"
6262
},
6363
{
6464
key.kind: source.lang.swift.decl.function.method.instance,
6565
key.name: "sameName(label:)",
66-
key.sourcetext: ".sameName(label: <#T##Int#>)",
6766
key.description: "<name>sameName</name>(<callarg><callarg.label>label</callarg.label>: <callarg.type><typeid.sys>Int</typeid.sys></callarg.type></callarg>)",
6867
key.typename: "<typeid.sys>Void</typeid.sys>",
6968
key.context: source.codecompletion.context.thisclass,
7069
key.typerelation: source.codecompletion.typerelation.unknown,
7170
key.num_bytes_to_erase: 0,
7271
key.associated_usrs: "s:29complete_annotateddescription8MyStructV8sameName5labelySi_tF",
73-
key.modulename: "complete_annotateddescription"
72+
key.modulename: "complete_annotateddescription",
73+
key.sourcetext: ".sameName(label: <#T##Int#>)"
7474
},
7575
{
7676
key.kind: source.lang.swift.keyword,
7777
key.name: "self",
78-
key.sourcetext: ".self",
7978
key.description: "<keyword>self</keyword>",
8079
key.typename: "<typeid.user>MyStruct</typeid.user>",
8180
key.context: source.codecompletion.context.thisclass,
8281
key.typerelation: source.codecompletion.typerelation.unknown,
83-
key.num_bytes_to_erase: 0
82+
key.num_bytes_to_erase: 0,
83+
key.sourcetext: ".self"
8484
}
8585
],
8686
key.annotated.typename: 1
@@ -90,82 +90,82 @@
9090
{
9191
key.kind: source.lang.swift.decl.function.constructor,
9292
key.name: "init()",
93-
key.sourcetext: "init()",
9493
key.description: "<name>init</name>()",
9594
key.typename: "<typeid.user>MyStruct</typeid.user>",
9695
key.context: source.codecompletion.context.thisclass,
9796
key.typerelation: source.codecompletion.typerelation.unknown,
9897
key.num_bytes_to_erase: 0,
9998
key.associated_usrs: "s:29complete_annotateddescription8MyStructVACycfc",
100-
key.modulename: "complete_annotateddescription"
99+
key.modulename: "complete_annotateddescription",
100+
key.sourcetext: "init()"
101101
},
102102
{
103103
key.kind: source.lang.swift.decl.function.method.instance,
104104
key.name: "labelName(:)",
105-
key.sourcetext: "labelName(<#T##self: MyStruct##MyStruct#>)",
106105
key.description: "<name>labelName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>self</callarg.param>: <callarg.type><typeid.user>MyStruct</typeid.user></callarg.type></callarg>)",
107106
key.typename: "(label: (<attribute>@autoclosure</attribute> () -&gt; <typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Void</typeid.sys>",
108107
key.context: source.codecompletion.context.thisclass,
109108
key.typerelation: source.codecompletion.typerelation.unknown,
110109
key.num_bytes_to_erase: 0,
111110
key.associated_usrs: "s:29complete_annotateddescription8MyStructV9labelName0E0yS2iyXKXE_tF",
112-
key.modulename: "complete_annotateddescription"
111+
key.modulename: "complete_annotateddescription",
112+
key.sourcetext: "labelName(<#T##self: MyStruct##MyStruct#>)"
113113
},
114114
{
115115
key.kind: source.lang.swift.decl.function.method.instance,
116116
key.name: "labelNameParamName(:)",
117-
key.sourcetext: "labelNameParamName(<#T##self: MyStruct##MyStruct#>)",
118117
key.description: "<name>labelNameParamName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>self</callarg.param>: <callarg.type><typeid.user>MyStruct</typeid.user></callarg.type></callarg>)",
119118
key.typename: "(label: (<keyword>inout</keyword> <typeid.sys>Int</typeid.sys>) <keyword>throws</keyword> -&gt; <typeid.user>MyStruct</typeid.user>) -&gt; <typeid.sys>Void</typeid.sys>",
120119
key.context: source.codecompletion.context.thisclass,
121120
key.typerelation: source.codecompletion.typerelation.unknown,
122121
key.num_bytes_to_erase: 0,
123122
key.associated_usrs: "s:29complete_annotateddescription8MyStructV014labelNameParamF00E0yACSizKXE_tKF",
124-
key.modulename: "complete_annotateddescription"
123+
key.modulename: "complete_annotateddescription",
124+
key.sourcetext: "labelNameParamName(<#T##self: MyStruct##MyStruct#>)"
125125
},
126126
{
127127
key.kind: source.lang.swift.decl.function.method.instance,
128128
key.name: "paramName(:)",
129-
key.sourcetext: "paramName(<#T##self: MyStruct##MyStruct#>)",
130129
key.description: "<name>paramName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>self</callarg.param>: <callarg.type><typeid.user>MyStruct</typeid.user></callarg.type></callarg>)",
131130
key.typename: "(<typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Void</typeid.sys>",
132131
key.context: source.codecompletion.context.thisclass,
133132
key.typerelation: source.codecompletion.typerelation.unknown,
134133
key.num_bytes_to_erase: 0,
135134
key.associated_usrs: "s:29complete_annotateddescription8MyStructV9paramNameyySiF",
136-
key.modulename: "complete_annotateddescription"
135+
key.modulename: "complete_annotateddescription",
136+
key.sourcetext: "paramName(<#T##self: MyStruct##MyStruct#>)"
137137
},
138138
{
139139
key.kind: source.lang.swift.decl.function.method.instance,
140140
key.name: "sameName(:)",
141-
key.sourcetext: "sameName(<#T##self: MyStruct##MyStruct#>)",
142141
key.description: "<name>sameName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>self</callarg.param>: <callarg.type><typeid.user>MyStruct</typeid.user></callarg.type></callarg>)",
143142
key.typename: "(label: <typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Void</typeid.sys>",
144143
key.context: source.codecompletion.context.thisclass,
145144
key.typerelation: source.codecompletion.typerelation.unknown,
146145
key.num_bytes_to_erase: 0,
147146
key.associated_usrs: "s:29complete_annotateddescription8MyStructV8sameName5labelySi_tF",
148-
key.modulename: "complete_annotateddescription"
147+
key.modulename: "complete_annotateddescription",
148+
key.sourcetext: "sameName(<#T##self: MyStruct##MyStruct#>)"
149149
},
150150
{
151151
key.kind: source.lang.swift.keyword,
152152
key.name: "self",
153-
key.sourcetext: "self",
154153
key.description: "<keyword>self</keyword>",
155154
key.typename: "<typeid.user>MyStruct</typeid.user>.Type",
156155
key.context: source.codecompletion.context.thisclass,
157156
key.typerelation: source.codecompletion.typerelation.unknown,
158-
key.num_bytes_to_erase: 0
157+
key.num_bytes_to_erase: 0,
158+
key.sourcetext: "self"
159159
},
160160
{
161161
key.kind: source.lang.swift.keyword,
162162
key.name: "Type",
163-
key.sourcetext: "Type",
164163
key.description: "<keyword>Type</keyword>",
165164
key.typename: "<typeid.user>MyStruct</typeid.user>.Type",
166165
key.context: source.codecompletion.context.thisclass,
167166
key.typerelation: source.codecompletion.typerelation.unknown,
168-
key.num_bytes_to_erase: 0
167+
key.num_bytes_to_erase: 0,
168+
key.sourcetext: "Type"
169169
}
170170
],
171171
key.reusingastcontext: 1,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %sourcekitd-test -req=complete -pos=45:1 %S/../Inputs/big_array.swift -- %S/../Inputs/big_array.swift | %FileCheck %s
22
// CHECK: key.kind: source.lang.swift.decl.var.global
33
// CHECK: key.name: "gCubeVertexData"
4-
// CHECK: key.sourcetext: "gCubeVertexData"
54
// CHECK: key.description: "gCubeVertexData"
65
// CHECK: key.typename: "[Float]"
6+
// CHECK: key.sourcetext: "gCubeVertexData"

test/SourceKit/CodeComplete/complete_cache.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ func test2() {
2626
for i in 1...#^VOID_2,fooFunc^# {}
2727
}
2828
// VOID_1: key.name: "fooFuncNoreturn1()",
29-
// VOID_1-NEXT: key.sourcetext:
3029
// VOID_1-NEXT: key.description:
3130
// VOID_1-NEXT: key.typename: "Never",
3231
// VOID_1-NEXT: key.context: source.codecompletion.context.othermodule,
3332
// VOID_1-NEXT: key.moduleimportdepth: 1,
3433
// VOID_1-NEXT: key.num_bytes_to_erase: 0,
3534
// VOID_1-NEXT: key.substructure:
35+
// VOID_1: key.sourcetext:
3636

3737
// VOID_1: key.name: "fooHelperSubFunc1(:)",
38-
// VOID_1-NEXT: key.sourcetext:
3938
// VOID_1-NEXT: key.description:
4039
// VOID_1-NEXT: key.typename: "Int32",
4140
// VOID_1-NEXT: key.context: source.codecompletion.context.othermodule,
4241
// VOID_1-NEXT: key.moduleimportdepth: 2,
4342
// VOID_1-NEXT: key.num_bytes_to_erase: 0,
4443
// VOID_1-NEXT: key.substructure:
44+
// VOID_1: key.sourcetext:
4545

4646
func test3() {
4747
#^VOID_3,fooFunc^# {}

test/SourceKit/CodeComplete/complete_constructor.swift.response

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
{
44
key.kind: source.lang.swift.decl.function.constructor,
55
key.name: "arg1:arg2:",
6-
key.sourcetext: "arg1: <#T##Int#>, arg2: <#T##Int#>",
76
key.description: "(arg1: Int, arg2: Int)",
87
key.typename: "Foo",
98
key.context: source.codecompletion.context.thisclass,
109
key.typerelation: source.codecompletion.typerelation.unknown,
1110
key.num_bytes_to_erase: 0,
1211
key.associated_usrs: "s:20complete_constructor3FooC4arg14arg2ACSi_Sitcfc",
13-
key.modulename: "complete_constructor"
12+
key.modulename: "complete_constructor",
13+
key.sourcetext: "arg1: <#T##Int#>, arg2: <#T##Int#>"
1414
}
1515
]
1616
}

test/SourceKit/CodeComplete/complete_docbrief_1.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,26 @@ func test() {
3030
// CHECK-NEXT: {
3131
// CHECK-NEXT: key.kind: source.lang.swift.decl.function.method.instance,
3232
// CHECK-NEXT: key.name: "bar()",
33-
// CHECK-NEXT: key.sourcetext: "bar()",
3433
// CHECK-NEXT: key.description: "bar()",
3534
// CHECK-NEXT: key.typename: "Void",
3635
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.bar",
3736
// CHECK-NEXT: key.context: source.codecompletion.context.superclass,
3837
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
3938
// CHECK-NEXT: key.num_bytes_to_erase: 0,
4039
// CHECK-NEXT: key.associated_usrs: "s:12DocBriefTest1PPAAE3baryyF",
41-
// CHECK-NEXT: key.modulename: "DocBriefTest"
40+
// CHECK-NEXT: key.modulename: "DocBriefTest",
41+
// CHECK-NEXT: key.sourcetext: "bar()"
4242
// CHECK-NEXT: },
4343
// CHECK-NEXT: {
4444
// CHECK-NEXT: key.kind: source.lang.swift.decl.function.method.instance,
4545
// CHECK-NEXT: key.name: "foo()",
46-
// CHECK-NEXT: key.sourcetext: "foo()",
4746
// CHECK-NEXT: key.description: "foo()",
4847
// CHECK-NEXT: key.typename: "Void",
4948
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.foo",
5049
// CHECK-NEXT: key.context: source.codecompletion.context.thisclass,
5150
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
5251
// CHECK-NEXT: key.num_bytes_to_erase: 0,
5352
// CHECK-NEXT: key.associated_usrs: "s:12DocBriefTest1SV3fooyyF s:12DocBriefTest1PP3fooyyF",
54-
// CHECK-NEXT: key.modulename: "DocBriefTest"
53+
// CHECK-NEXT: key.modulename: "DocBriefTest",
54+
// CHECK-NEXT: key.sourcetext: "foo()"
5555
// CHECK-NEXT: }

test/SourceKit/CodeComplete/complete_docbrief_2.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ func test() {
3232
// CHECK-NEXT: {
3333
// CHECK-NEXT: key.kind: source.lang.swift.decl.function.method.instance,
3434
// CHECK-NEXT: key.name: "foo()",
35-
// CHECK-NEXT: key.sourcetext: "foo()",
3635
// CHECK-NEXT: key.description: "foo()",
3736
// CHECK-NEXT: key.typename: "Void",
3837
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.foo",
3938
// CHECK-NEXT: key.context: source.codecompletion.context.thisclass,
4039
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
4140
// CHECK-NEXT: key.num_bytes_to_erase: 0,
4241
// CHECK-NEXT: key.associated_usrs: "s:12DocBriefUser1SV3fooyyF s:12DocBriefTest1PP3fooyyF",
43-
// CHECK-NEXT: key.modulename: "DocBriefUser"
42+
// CHECK-NEXT: key.modulename: "DocBriefUser",
43+
// CHECK-NEXT: key.sourcetext: "foo()"
4444
// CHECK-NEXT: }
4545
}

test/SourceKit/CodeComplete/complete_docbrief_3.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ func test() {
3333
// CHECK-NEXT: {
3434
// CHECK-NEXT: key.kind: source.lang.swift.decl.function.method.instance,
3535
// CHECK-NEXT: key.name: "foo()",
36-
// CHECK-NEXT: key.sourcetext: "foo()",
3736
// CHECK-NEXT: key.description: "foo()",
3837
// CHECK-NEXT: key.typename: "Void",
3938
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.foo",
4039
// CHECK-NEXT: key.context: source.codecompletion.context.thisclass,
4140
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
4241
// CHECK-NEXT: key.num_bytes_to_erase: 0,
4342
// CHECK-NEXT: key.associated_usrs: "s:12DocBriefTest1SV3fooyyF s:12DocBriefTest1PP3fooyyF",
44-
// CHECK-NEXT: key.modulename: "DocBriefTest"
43+
// CHECK-NEXT: key.modulename: "DocBriefTest",
44+
// CHECK-NEXT: key.sourcetext: "foo()"
4545
// CHECK-NEXT: }
4646
}

test/SourceKit/CodeComplete/complete_docbrief_package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ func test() {
3535
// CHECK-NEXT: {
3636
// CHECK-NEXT: key.kind: source.lang.swift.decl.function.method.instance,
3737
// CHECK-NEXT: key.name: "foo()",
38-
// CHECK-NEXT: key.sourcetext: "foo()",
3938
// CHECK-NEXT: key.description: "foo()",
4039
// CHECK-NEXT: key.typename: "Void",
4140
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.foo",
41+
// CHECK: key.sourcetext: "foo()"
4242
// CHECK: }
4343
}

test/SourceKit/CodeComplete/complete_docbrief_spi.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ func test() {
3636
// CHECK-NEXT: {
3737
// CHECK-NEXT: key.kind: source.lang.swift.decl.function.method.instance,
3838
// CHECK-NEXT: key.name: "foo()",
39-
// CHECK-NEXT: key.sourcetext: "foo()",
4039
// CHECK-NEXT: key.description: "foo()",
4140
// CHECK-NEXT: key.typename: "Void",
4241
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.foo",
42+
// CHECK: key.sourcetext: "foo()"
4343
// CHECK: }
4444
}

test/SourceKit/CodeComplete/complete_from_clang_module.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import Foo
44
// RUN: %sourcekitd-test -req=complete -pos=2:1 %s -- -F %S/../Inputs/libIDE-mock-sdk %s | %FileCheck %s
55

66
// CHECK-LABEL: key.name: "fooIntVar",
7-
// CHECK-NEXT: key.sourcetext: "fooIntVar",
87
// CHECK-NEXT: key.description: "fooIntVar",
98
// CHECK-NEXT: key.typename: "Int32",
109
// CHECK-NEXT: key.doc.brief: "Aaa. fooIntVar. Bbb.",
1110
// CHECK-NEXT: key.context: source.codecompletion.context.othermodule,
1211
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
1312
// CHECK-NEXT: key.num_bytes_to_erase: 0,
1413
// CHECK-NEXT: key.associated_usrs: "c:@fooIntVar",
15-
// CHECK-NEXT: key.modulename: "Foo"
14+
// CHECK-NEXT: key.modulename: "Foo",
15+
// CHECK-NEXT: key.sourcetext: "fooIntVar"
1616
// CHECK-NEXT: },
1717

0 commit comments

Comments
 (0)