Skip to content

Commit 1675224

Browse files
committed
small inconsistencies
1 parent 4faf965 commit 1675224

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

jedi_language_server/text_edit_utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,12 @@ def lsp_text_document_edits(self) -> Iterator[TextDocumentEdit]:
7676
for path, changed_file in changed_files.items():
7777
uri = path.as_uri()
7878
document = self.workspace.get_text_document(uri)
79-
notebook = notebook_utils.notebook_coordinate_mapper(
79+
notebook_mapper = notebook_utils.notebook_coordinate_mapper(
8080
self.workspace, notebook_uri=uri
8181
)
82-
source = notebook.source if notebook else document.source
82+
source = (
83+
notebook_mapper.source if notebook_mapper else document.source
84+
)
8385
version = 0 if document.version is None else document.version
8486
text_edits = lsp_text_edits(source, changed_file)
8587
if text_edits:
@@ -90,8 +92,8 @@ def lsp_text_document_edits(self) -> Iterator[TextDocumentEdit]:
9092
),
9193
edits=text_edits,
9294
)
93-
if notebook is not None:
94-
yield from notebook.cell_text_document_edits(
95+
if notebook_mapper is not None:
96+
yield from notebook_mapper.cell_text_document_edits(
9597
text_document_edit
9698
)
9799
else:

tests/lsp_tests/test_refactoring.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def test_lsp_rename_function_notebook():
163163
},
164164
],
165165
}
166-
assert actual == expected
166+
assert_that(actual, is_(expected))
167167

168168

169169
def test_lsp_rename_variable_at_line_start():
@@ -398,7 +398,7 @@ def test_rename_package_notebook() -> None:
398398
},
399399
]
400400
}
401-
assert actual == expected
401+
assert_that(actual, is_(expected))
402402

403403

404404
def test_rename_module() -> None:

0 commit comments

Comments
 (0)