@@ -95,7 +95,7 @@ final class LocalSwiftTests: XCTestCase {
95
95
} )
96
96
97
97
sk. sendNoteSync ( DidChangeTextDocumentNotification ( textDocument: . init( uri, version: 14 ) , contentChanges: [
98
- . init( range: Range ( Position ( line: 1 , utf16index: 0 ) ) , text: " _ = bar()" )
98
+ . init( range: Range ( Position ( line: 1 , utf16index: 0 ) ) , text: " bar() " )
99
99
] ) , { ( note: Notification < PublishDiagnosticsNotification > ) in
100
100
log ( " Received diagnostics for edit 2 - syntactic " )
101
101
XCTAssertEqual ( note. params. version, 14 )
@@ -104,19 +104,19 @@ final class LocalSwiftTests: XCTestCase {
104
104
XCTAssertLessThanOrEqual ( note. params. diagnostics. count, 1 )
105
105
XCTAssertEqual ( """
106
106
func foo() {}
107
- _ = bar()
107
+ bar()
108
108
""" , self . workspace. documentManager. latestSnapshot ( uri) !. text)
109
109
} , { ( note: Notification < PublishDiagnosticsNotification > ) in
110
110
log ( " Received diagnostics for edit 2 - semantic " )
111
111
XCTAssertEqual ( note. params. version, 14 )
112
112
XCTAssertEqual ( note. params. diagnostics. count, 1 )
113
113
XCTAssertEqual (
114
114
note. params. diagnostics. first? . range. lowerBound,
115
- Position ( line: 1 , utf16index: 4 ) )
115
+ Position ( line: 1 , utf16index: 0 ) )
116
116
} )
117
117
118
118
sk. sendNoteSync ( DidChangeTextDocumentNotification ( textDocument: . init( uri, version: 14 ) , contentChanges: [
119
- . init( range: Position ( line: 1 , utf16index: 4 ) ..< Position ( line: 1 , utf16index: 7 ) , text: " foo " )
119
+ . init( range: Position ( line: 1 , utf16index: 0 ) ..< Position ( line: 1 , utf16index: 3 ) , text: " foo " )
120
120
] ) , { ( note: Notification < PublishDiagnosticsNotification > ) in
121
121
log ( " Received diagnostics for edit 3 - syntactic " )
122
122
// 1 = remaining semantic error
@@ -125,7 +125,7 @@ final class LocalSwiftTests: XCTestCase {
125
125
XCTAssertLessThanOrEqual ( note. params. diagnostics. count, 1 )
126
126
XCTAssertEqual ( """
127
127
func foo() {}
128
- _ = foo()
128
+ foo()
129
129
""" , self . workspace. documentManager. latestSnapshot ( uri) !. text)
130
130
} , { ( note: Notification < PublishDiagnosticsNotification > ) in
131
131
log ( " Received diagnostics for edit 3 - semantic " )
@@ -134,7 +134,7 @@ final class LocalSwiftTests: XCTestCase {
134
134
} )
135
135
136
136
sk. sendNoteSync ( DidChangeTextDocumentNotification ( textDocument: . init( uri, version: 15 ) , contentChanges: [
137
- . init( range: Position ( line: 1 , utf16index: 4 ) ..< Position ( line: 1 , utf16index: 7 ) , text: " fooTypo " )
137
+ . init( range: Position ( line: 1 , utf16index: 0 ) ..< Position ( line: 1 , utf16index: 3 ) , text: " fooTypo " )
138
138
] ) , { ( note: Notification < PublishDiagnosticsNotification > ) in
139
139
log ( " Received diagnostics for edit 4 - syntactic " )
140
140
XCTAssertEqual ( note. params. version, 15 )
@@ -143,21 +143,21 @@ final class LocalSwiftTests: XCTestCase {
143
143
XCTAssertLessThanOrEqual ( note. params. diagnostics. count, 1 )
144
144
XCTAssertEqual ( """
145
145
func foo() {}
146
- _ = fooTypo()
146
+ fooTypo()
147
147
""" , self . workspace. documentManager. latestSnapshot ( uri) !. text)
148
148
} , { ( note: Notification < PublishDiagnosticsNotification > ) in
149
149
log ( " Received diagnostics for edit 4 - semantic " )
150
150
XCTAssertEqual ( note. params. version, 15 )
151
151
XCTAssertEqual ( note. params. diagnostics. count, 1 )
152
152
XCTAssertEqual (
153
153
note. params. diagnostics. first? . range. lowerBound,
154
- Position ( line: 1 , utf16index: 4 ) )
154
+ Position ( line: 1 , utf16index: 0 ) )
155
155
} )
156
156
157
157
sk. sendNoteSync ( DidChangeTextDocumentNotification ( textDocument: . init( uri, version: 16 ) , contentChanges: [
158
158
. init( range: nil , text: """
159
159
func bar() {}
160
- _ = foo()
160
+ foo()
161
161
""" )
162
162
] ) , { ( note: Notification < PublishDiagnosticsNotification > ) in
163
163
log ( " Received diagnostics for edit 5 - syntactic " )
@@ -166,15 +166,15 @@ final class LocalSwiftTests: XCTestCase {
166
166
XCTAssertEqual ( note. params. diagnostics. count, 1 )
167
167
XCTAssertEqual ( """
168
168
func bar() {}
169
- _ = foo()
169
+ foo()
170
170
""" , self . workspace. documentManager. latestSnapshot ( uri) !. text)
171
171
} , { ( note: Notification < PublishDiagnosticsNotification > ) in
172
172
log ( " Received diagnostics for edit 5 - semantic " )
173
173
XCTAssertEqual ( note. params. version, 16 )
174
174
XCTAssertEqual ( note. params. diagnostics. count, 1 )
175
175
XCTAssertEqual (
176
176
note. params. diagnostics. first? . range. lowerBound,
177
- Position ( line: 1 , utf16index: 4 ) )
177
+ Position ( line: 1 , utf16index: 0 ) )
178
178
} )
179
179
}
180
180
@@ -220,7 +220,7 @@ final class LocalSwiftTests: XCTestCase {
220
220
} )
221
221
222
222
sk. sendNoteSync ( DidChangeTextDocumentNotification ( textDocument: . init( uri, version: 14 ) , contentChanges: [
223
- . init( range: Range ( Position ( line: 1 , utf16index: 0 ) ) , text: " _ = bar()" )
223
+ . init( range: Range ( Position ( line: 1 , utf16index: 0 ) ) , text: " bar() " )
224
224
] ) , { ( note: Notification < PublishDiagnosticsNotification > ) in
225
225
log ( " Received diagnostics for edit 2 - syntactic " )
226
226
XCTAssertEqual ( note. params. version, 14 )
@@ -229,19 +229,19 @@ final class LocalSwiftTests: XCTestCase {
229
229
XCTAssertLessThanOrEqual ( note. params. diagnostics. count, 1 )
230
230
XCTAssertEqual ( """
231
231
func foo() {}
232
- _ = bar()
232
+ bar()
233
233
""" , self . workspace. documentManager. latestSnapshot ( uri) !. text)
234
234
} , { ( note: Notification < PublishDiagnosticsNotification > ) in
235
235
log ( " Received diagnostics for edit 2 - semantic " )
236
236
XCTAssertEqual ( note. params. version, 14 )
237
237
XCTAssertEqual ( note. params. diagnostics. count, 1 )
238
238
XCTAssertEqual (
239
239
note. params. diagnostics. first? . range. lowerBound,
240
- Position ( line: 1 , utf16index: 4 ) )
240
+ Position ( line: 1 , utf16index: 0 ) )
241
241
} )
242
242
243
243
sk. sendNoteSync ( DidChangeTextDocumentNotification ( textDocument: . init( uri, version: 14 ) , contentChanges: [
244
- . init( range: Position ( line: 1 , utf16index: 4 ) ..< Position ( line: 1 , utf16index: 7 ) , text: " foo " )
244
+ . init( range: Position ( line: 1 , utf16index: 0 ) ..< Position ( line: 1 , utf16index: 3 ) , text: " foo " )
245
245
] ) , { ( note: Notification < PublishDiagnosticsNotification > ) in
246
246
log ( " Received diagnostics for edit 3 - syntactic " )
247
247
XCTAssertEqual ( note. params. version, 14 )
@@ -250,7 +250,7 @@ final class LocalSwiftTests: XCTestCase {
250
250
XCTAssertLessThanOrEqual ( note. params. diagnostics. count, 1 )
251
251
XCTAssertEqual ( """
252
252
func foo() {}
253
- _ = foo()
253
+ foo()
254
254
""" , self . workspace. documentManager. latestSnapshot ( uri) !. text)
255
255
} , { ( note: Notification < PublishDiagnosticsNotification > ) in
256
256
log ( " Received diagnostics for edit 3 - semantic " )
@@ -259,7 +259,7 @@ final class LocalSwiftTests: XCTestCase {
259
259
} )
260
260
261
261
sk. sendNoteSync ( DidChangeTextDocumentNotification ( textDocument: . init( uri, version: 15 ) , contentChanges: [
262
- . init( range: Position ( line: 1 , utf16index: 4 ) ..< Position ( line: 1 , utf16index: 7 ) , text: " fooTypo " )
262
+ . init( range: Position ( line: 1 , utf16index: 0 ) ..< Position ( line: 1 , utf16index: 3 ) , text: " fooTypo " )
263
263
] ) , { ( note: Notification < PublishDiagnosticsNotification > ) in
264
264
log ( " Received diagnostics for edit 4 - syntactic " )
265
265
XCTAssertEqual ( note. params. version, 15 )
@@ -268,21 +268,21 @@ final class LocalSwiftTests: XCTestCase {
268
268
XCTAssertLessThanOrEqual ( note. params. diagnostics. count, 1 )
269
269
XCTAssertEqual ( """
270
270
func foo() {}
271
- _ = fooTypo()
271
+ fooTypo()
272
272
""" , self . workspace. documentManager. latestSnapshot ( uri) !. text)
273
273
} , { ( note: Notification < PublishDiagnosticsNotification > ) in
274
274
log ( " Received diagnostics for edit 4 - semantic " )
275
275
XCTAssertEqual ( note. params. version, 15 )
276
276
XCTAssertEqual ( note. params. diagnostics. count, 1 )
277
277
XCTAssertEqual (
278
278
note. params. diagnostics. first? . range. lowerBound,
279
- Position ( line: 1 , utf16index: 4 ) )
279
+ Position ( line: 1 , utf16index: 0 ) )
280
280
} )
281
281
282
282
sk. sendNoteSync ( DidChangeTextDocumentNotification ( textDocument: . init( uri, version: 16 ) , contentChanges: [
283
283
. init( range: nil , text: """
284
284
func bar() {}
285
- _ = foo()
285
+ foo()
286
286
""" )
287
287
] ) , { ( note: Notification < PublishDiagnosticsNotification > ) in
288
288
log ( " Received diagnostics for edit 5 - syntactic " )
@@ -291,15 +291,15 @@ final class LocalSwiftTests: XCTestCase {
291
291
XCTAssertEqual ( note. params. diagnostics. count, 1 )
292
292
XCTAssertEqual ( """
293
293
func bar() {}
294
- _ = foo()
294
+ foo()
295
295
""" , self . workspace. documentManager. latestSnapshot ( uri) !. text)
296
296
} , { ( note: Notification < PublishDiagnosticsNotification > ) in
297
297
log ( " Received diagnostics for edit 5 - semantic " )
298
298
XCTAssertEqual ( note. params. version, 16 )
299
299
XCTAssertEqual ( note. params. diagnostics. count, 1 )
300
300
XCTAssertEqual (
301
301
note. params. diagnostics. first? . range. lowerBound,
302
- Position ( line: 1 , utf16index: 4 ) )
302
+ Position ( line: 1 , utf16index: 0 ) )
303
303
} )
304
304
}
305
305
@@ -314,7 +314,7 @@ final class LocalSwiftTests: XCTestCase {
314
314
sk. sendNoteSync ( DidOpenTextDocumentNotification ( textDocument: TextDocumentItem (
315
315
uri: uriA, language: . swift, version: 12 ,
316
316
text: """
317
- _ = foo()
317
+ foo()
318
318
"""
319
319
) ) , { ( note: Notification < PublishDiagnosticsNotification > ) in
320
320
log ( " Received diagnostics for open - syntactic " )
@@ -328,13 +328,13 @@ final class LocalSwiftTests: XCTestCase {
328
328
XCTAssertEqual ( note. params. diagnostics. count, 1 )
329
329
XCTAssertEqual (
330
330
note. params. diagnostics. first? . range. lowerBound,
331
- Position ( line: 0 , utf16index: 4 ) )
331
+ Position ( line: 0 , utf16index: 0 ) )
332
332
} )
333
333
334
334
sk. sendNoteSync ( DidOpenTextDocumentNotification ( textDocument: TextDocumentItem (
335
335
uri: uriB, language: . swift, version: 12 ,
336
336
text: """
337
- _ = bar()
337
+ bar()
338
338
"""
339
339
) ) , { ( note: Notification < PublishDiagnosticsNotification > ) in
340
340
log ( " Received diagnostics for open - syntactic " )
@@ -348,11 +348,11 @@ final class LocalSwiftTests: XCTestCase {
348
348
XCTAssertEqual ( note. params. diagnostics. count, 1 )
349
349
XCTAssertEqual (
350
350
note. params. diagnostics. first? . range. lowerBound,
351
- Position ( line: 0 , utf16index: 4 ) )
351
+ Position ( line: 0 , utf16index: 0 ) )
352
352
} )
353
353
354
354
sk. sendNoteSync ( DidChangeTextDocumentNotification ( textDocument: . init( uriA, version: 13 ) , contentChanges: [
355
- . init( range: nil , text: " _ = foo()\n " )
355
+ . init( range: nil , text: " foo() \n " )
356
356
] ) , { ( note: Notification < PublishDiagnosticsNotification > ) in
357
357
log ( " Received diagnostics for edit 1 - syntactic " )
358
358
XCTAssertEqual ( note. params. version, 13 )
@@ -372,7 +372,7 @@ final class LocalSwiftTests: XCTestCase {
372
372
sk. sendNoteSync ( DidOpenTextDocumentNotification ( textDocument: TextDocumentItem (
373
373
uri: uriA, language: . swift, version: 12 ,
374
374
text: """
375
- _ = foo()
375
+ foo()
376
376
"""
377
377
) ) , { ( note: Notification < PublishDiagnosticsNotification > ) in
378
378
log ( " Received diagnostics for open - syntactic " )
@@ -386,7 +386,7 @@ final class LocalSwiftTests: XCTestCase {
386
386
XCTAssertEqual ( note. params. diagnostics. count, 1 )
387
387
XCTAssertEqual (
388
388
note. params. diagnostics. first? . range. lowerBound,
389
- Position ( line: 0 , utf16index: 4 ) )
389
+ Position ( line: 0 , utf16index: 0 ) )
390
390
} )
391
391
392
392
sk. send ( DidCloseTextDocumentNotification ( textDocument: . init( urlA) ) )
0 commit comments