Skip to content

Commit 7e00332

Browse files
committed
simplify params arg
1 parent 0a495ff commit 7e00332

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

jedi_language_server/notebook_utils.py

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -279,26 +279,6 @@ def cell_filename(
279279
TextDocumentPositionParams,
280280
)
281281

282-
_TextDocumentCoordinatesParams = Union[
283-
CallHierarchyPrepareParams,
284-
CodeActionParams,
285-
ColorPresentationParams,
286-
CompletionParams,
287-
DefinitionParams,
288-
DocumentHighlightParams,
289-
DocumentOnTypeFormattingParams,
290-
HoverParams,
291-
InlayHintParams,
292-
InlineValueParams,
293-
PrepareRenameParams,
294-
ReferenceParams,
295-
RenameParams,
296-
SemanticTokensRangeParams,
297-
SignatureHelpParams,
298-
TextDocumentPositionParams,
299-
]
300-
301-
302282
T = TypeVar("T")
303283

304284

@@ -354,7 +334,7 @@ def _notebook_params(
354334
def _cell_results(
355335
workspace: Workspace,
356336
mapper: Optional[NotebookCoordinateMapper],
357-
params: _TextDocumentCoordinatesParams,
337+
cell_uri: str,
358338
result: T,
359339
) -> T:
360340
if isinstance(result, list) and result and isinstance(result[0], Location):
@@ -366,7 +346,7 @@ def _cell_results(
366346
and result.range is not None
367347
):
368348
location = mapper.cell_range(result.range)
369-
if location is not None and location.uri == params.text_document.uri:
349+
if location is not None and location.uri == cell_uri:
370350
return cast(T, attrs.evolve(result, range=location.range))
371351

372352
return result
@@ -392,7 +372,7 @@ def wrapped(ls: T_ls, params: T_params) -> T:
392372
notebook_server = cast(T_ls, ServerWrapper(ls))
393373
result = f(notebook_server, notebook_params)
394374
return _cell_results(
395-
notebook_server.workspace, mapper, notebook_params, result
375+
notebook_server.workspace, mapper, params.text_document.uri, result
396376
)
397377

398378
return wrapped

0 commit comments

Comments
 (0)