44
55import pytest
66from pylsp import uris
7-
7+ from pylsp . workspace import apply_text_edits
88
99DOC_URI = uris .from_fs_path (__file__ )
1010
@@ -299,7 +299,7 @@ def test_apply_text_edits_insert(pylsp):
299299 pylsp .workspace .put_document (DOC_URI , '012345678901234567890123456789' )
300300 test_doc = pylsp .workspace .get_document (DOC_URI )
301301
302- assert test_doc . apply_text_edits ([{
302+ assert apply_text_edits (test_doc , [{
303303 "range" : {
304304 "start" : {
305305 "line" : 0 ,
@@ -312,7 +312,7 @@ def test_apply_text_edits_insert(pylsp):
312312 },
313313 "newText" : "Hello"
314314 }]) == 'Hello012345678901234567890123456789'
315- assert test_doc . apply_text_edits ([{
315+ assert apply_text_edits (test_doc , [{
316316 "range" : {
317317 "start" : {
318318 "line" : 0 ,
@@ -325,7 +325,7 @@ def test_apply_text_edits_insert(pylsp):
325325 },
326326 "newText" : "Hello"
327327 }]) == '0Hello12345678901234567890123456789'
328- assert test_doc . apply_text_edits ([{
328+ assert apply_text_edits (test_doc , [{
329329 "range" : {
330330 "start" : {
331331 "line" : 0 ,
@@ -350,7 +350,7 @@ def test_apply_text_edits_insert(pylsp):
350350 },
351351 "newText" : "World"
352352 }]) == '0HelloWorld12345678901234567890123456789'
353- assert test_doc . apply_text_edits ([{
353+ assert apply_text_edits (test_doc , [{
354354 "range" : {
355355 "start" : {
356356 "line" : 0 ,
@@ -416,7 +416,7 @@ def test_apply_text_edits_replace(pylsp):
416416 pylsp .workspace .put_document (DOC_URI , '012345678901234567890123456789' )
417417 test_doc = pylsp .workspace .get_document (DOC_URI )
418418
419- assert test_doc . apply_text_edits ([{
419+ assert apply_text_edits (test_doc , [{
420420 "range" : {
421421 "start" : {
422422 "line" : 0 ,
@@ -429,7 +429,7 @@ def test_apply_text_edits_replace(pylsp):
429429 },
430430 "newText" : "Hello"
431431 }]) == '012Hello678901234567890123456789'
432- assert test_doc . apply_text_edits ([{
432+ assert apply_text_edits (test_doc , [{
433433 "range" : {
434434 "start" : {
435435 "line" : 0 ,
@@ -454,7 +454,7 @@ def test_apply_text_edits_replace(pylsp):
454454 },
455455 "newText" : "World"
456456 }]) == '012HelloWorld901234567890123456789'
457- assert test_doc . apply_text_edits ([{
457+ assert apply_text_edits (test_doc , [{
458458 "range" : {
459459 "start" : {
460460 "line" : 0 ,
@@ -479,7 +479,7 @@ def test_apply_text_edits_replace(pylsp):
479479 },
480480 "newText" : "World"
481481 }]) == '012HelloWorld678901234567890123456789'
482- assert test_doc . apply_text_edits ([{
482+ assert apply_text_edits (test_doc , [{
483483 "range" : {
484484 "start" : {
485485 "line" : 0 ,
@@ -504,7 +504,7 @@ def test_apply_text_edits_replace(pylsp):
504504 },
505505 "newText" : "Hello"
506506 }]) == '012HelloWorld678901234567890123456789'
507- assert test_doc . apply_text_edits ([{
507+ assert apply_text_edits (test_doc , [{
508508 "range" : {
509509 "start" : {
510510 "line" : 0 ,
@@ -537,7 +537,7 @@ def test_apply_text_edits_overlap(pylsp):
537537
538538 did_throw = False
539539 try :
540- test_doc . apply_text_edits ([{
540+ apply_text_edits (test_doc , [{
541541 "range" : {
542542 "start" : {
543543 "line" : 0 ,
@@ -568,7 +568,7 @@ def test_apply_text_edits_overlap(pylsp):
568568 assert did_throw
569569
570570 try :
571- test_doc . apply_text_edits ([{
571+ apply_text_edits (test_doc , [{
572572 "range" : {
573573 "start" : {
574574 "line" : 0 ,
@@ -602,7 +602,7 @@ def test_apply_text_edits_multiline(pylsp):
602602 pylsp .workspace .put_document (DOC_URI , '0\n 1\n 2\n 3\n 4' )
603603 test_doc = pylsp .workspace .get_document (DOC_URI )
604604
605- assert test_doc . apply_text_edits ([{
605+ assert apply_text_edits (test_doc , [{
606606 "range" : {
607607 "start" : {
608608 "line" : 2 ,
0 commit comments