@@ -201,7 +201,7 @@ describe('completion', () => {
201
201
server . didCloseTextDocument ( { textDocument : doc } ) ;
202
202
} ) ;
203
203
204
- it ( 'completions for clients that do not support insertReplaceSupport' , async ( ) => {
204
+ it ( 'completions for clients that support insertReplaceSupport' , async ( ) => {
205
205
const doc = {
206
206
uri : uri ( 'bar.ts' ) ,
207
207
languageId : 'typescript' ,
@@ -221,16 +221,16 @@ describe('completion', () => {
221
221
const completion = proposals ! . items . find ( completion => completion . label === 'getById' ) ;
222
222
assert . isDefined ( completion ) ;
223
223
assert . isDefined ( completion ! . textEdit ) ;
224
- assert . containsAllKeys ( completion ! . textEdit , [ 'newText' , 'range ' ] ) ;
224
+ assert . containsAllKeys ( completion ! . textEdit , [ 'newText' , 'insert' , 'replace '] ) ;
225
225
server . didCloseTextDocument ( { textDocument : doc } ) ;
226
226
} ) ;
227
227
228
- it ( 'completions for clients that support insertReplaceSupport' , async ( ) => {
228
+ it ( 'completions for clients that do not support insertReplaceSupport' , async ( ) => {
229
229
const clientCapabilitiesOverride : lsp . ClientCapabilities = {
230
230
textDocument : {
231
231
completion : {
232
232
completionItem : {
233
- insertReplaceSupport : true ,
233
+ insertReplaceSupport : false ,
234
234
} ,
235
235
} ,
236
236
} ,
@@ -258,8 +258,7 @@ describe('completion', () => {
258
258
assert . isNotNull ( proposals ) ;
259
259
const completion = proposals ! . items . find ( completion => completion . label === 'getById' ) ;
260
260
assert . isDefined ( completion ) ;
261
- assert . isDefined ( completion ! . textEdit ) ;
262
- assert . containsAllKeys ( completion ! . textEdit , [ 'newText' , 'insert' , 'replace' ] ) ;
261
+ assert . isUndefined ( completion ! . textEdit ) ;
263
262
localServer . didCloseTextDocument ( { textDocument : doc } ) ;
264
263
localServer . closeAll ( ) ;
265
264
localServer . shutdown ( ) ;
@@ -401,7 +400,7 @@ describe('completion', () => {
401
400
return true;
402
401
}
403
402
404
- test("fs/")
403
+ test("fs/r ")
405
404
` ,
406
405
} ;
407
406
server . didOpenTextDocument ( { textDocument : doc } ) ;
@@ -417,11 +416,27 @@ describe('completion', () => {
417
416
const completion = proposals ! . items . find ( completion => completion . label === 'fs/read' ) ;
418
417
assert . strictEqual ( completion ! . label , 'fs/read' ) ;
419
418
assert . deepStrictEqual ( completion ! . textEdit , {
420
- range : {
421
- start : { line : 5 , character : 20 } ,
422
- end : { line : 5 , character : 23 } ,
423
- } ,
424
419
newText : 'fs/read' ,
420
+ insert : {
421
+ start : {
422
+ line : 5 ,
423
+ character : 20 ,
424
+ } ,
425
+ end : {
426
+ line : 5 ,
427
+ character : 23 ,
428
+ } ,
429
+ } ,
430
+ replace : {
431
+ start : {
432
+ line : 5 ,
433
+ character : 20 ,
434
+ } ,
435
+ end : {
436
+ line : 5 ,
437
+ character : 24 ,
438
+ } ,
439
+ } ,
425
440
} ) ;
426
441
} ) ;
427
442
0 commit comments