Skip to content

Commit fa394ad

Browse files
committed
Fix not passing doc to apply_text_edit
I remember doing this and running tests!
1 parent 0565667 commit fa394ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/plugins/test_yapf_format.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_format(workspace):
2525
doc = Document(DOC_URI, workspace, DOC)
2626
res = pylsp_format_document(doc)
2727

28-
assert apply_text_edits(res) == "A = ['h', 'w', 'a']\n\nB = ['h', 'w']\n"
28+
assert apply_text_edits(doc, res) == "A = ['h', 'w', 'a']\n\nB = ['h', 'w']\n"
2929

3030

3131
def test_range_format(workspace):
@@ -38,7 +38,7 @@ def test_range_format(workspace):
3838
res = pylsp_format_range(doc, def_range)
3939

4040
# Make sure B is still badly formatted
41-
assert apply_text_edits(res) == "A = ['h', 'w', 'a']\n\nB = ['h',\n\n\n'w']\n"
41+
assert apply_text_edits(doc, res) == "A = ['h', 'w', 'a']\n\nB = ['h',\n\n\n'w']\n"
4242

4343

4444
def test_no_change(workspace):
@@ -56,10 +56,10 @@ def test_config_file(tmpdir, workspace):
5656
res = pylsp_format_document(doc)
5757

5858
# A was split on multiple lines because of column_limit from config file
59-
assert apply_text_edits(res) == "A = [\n 'h', 'w',\n 'a'\n]\n\nB = ['h', 'w']\n"
59+
assert apply_text_edits(doc, res) == "A = [\n 'h', 'w',\n 'a'\n]\n\nB = ['h', 'w']\n"
6060

6161
def test_cr_line_endings(workspace):
6262
doc = Document(DOC_URI, workspace, 'import os;import sys\r\rdict(a=1)')
6363
res = pylsp_format_document(doc)
6464

65-
assert apply_text_edits(res) == 'import os\rimport sys\r\rdict(a=1)\r'
65+
assert apply_text_edits(doc, res) == 'import os\rimport sys\r\rdict(a=1)'

0 commit comments

Comments
 (0)