Skip to content

Commit 3e1de28

Browse files
committed
[complete-test] Stop inserting \0 in complete-test
Using \0 as a representation of the cursor position is a implementation detail and is done by SourceKit. Client including complete-test should not do it. This inserted test used to be treated as EOF in compiler so the code after the completion position is completely ignored.
1 parent 0fc9bae commit 3e1de28

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

test/SourceKit/CodeComplete/complete_group_overloads.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ func test005() {
8989
// BAR_INIT_0: ()
9090
// BAR_INIT_0-NEXT: (x: A)
9191
// BAR_INIT_0-NEXT: (x: B)
92+
// BAR_INIT_0-NEXT: .foo(self: Bar)
9293
// BAR_INIT_0-NEXT: .self
9394

9495
extension Bar {

test/SourceKit/CodeComplete/complete_requestlimit.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ func test001() {
3232
// TOP_LEVEL_0_ALL-NEXT: z
3333
// TOP_LEVEL_0_ALL-NEXT: A
3434
// TOP_LEVEL_0_ALL-NEXT: B
35+
// TOP_LEVEL_0_ALL-NEXT: C
36+
// TOP_LEVEL_0_ALL-NEXT: D
3537
// TOP_LEVEL_0_ALL-NEXT: test
3638

3739
// TOP_LEVEL_0_3: let

test/SourceKit/CodeComplete/complete_sort_order.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func test6() {
190190
// VOID_1_RAW-NEXT: key.sourcetext: "foo1()",
191191
// VOID_1_RAW-NEXT: key.description: "foo1()",
192192
// VOID_1_RAW-NEXT: key.typename: "Void",
193-
// VOID_1_RAW-NEXT: key.context: source.codecompletion.context.thismodule,
193+
// VOID_1_RAW-NEXT: key.context: source.codecompletion.context.local,
194194
// VOID_1_RAW-NEXT: key.num_bytes_to_erase: 0,
195195
// VOID_1_RAW-NEXT: key.not_recommended: 1,
196196

@@ -205,8 +205,8 @@ func test7() {
205205
#^CASE_0,caseSensitiveCheck,CaseSensitiveCheck^#
206206
}
207207
// CASE_0: Results for filterText: caseSensitiveCheck [
208-
// CASE_0: caseSensitiveCheck
209208
// CASE_0: CaseSensitiveCheck
209+
// CASE_0: caseSensitiveCheck
210210
// CASE_0: caseSensitiveCheck.
211211
// CASE_0: ]
212212
// CASE_0: Results for filterText: CaseSensitiveCheck [

tools/SourceKit/tools/complete-test/complete-test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ removeCodeCompletionTokens(StringRef Input, StringRef TokenName,
392392
if (match[1].str() != TokenName)
393393
continue;
394394
*CompletionOffset = CleanFile.size();
395-
CleanFile.push_back('\0');
396395
if (match.size() == 2 || !match[2].matched)
397396
continue;
398397

0 commit comments

Comments
 (0)