@@ -279,26 +279,6 @@ def cell_filename(
279
279
TextDocumentPositionParams ,
280
280
)
281
281
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
-
302
282
T = TypeVar ("T" )
303
283
304
284
@@ -354,7 +334,7 @@ def _notebook_params(
354
334
def _cell_results (
355
335
workspace : Workspace ,
356
336
mapper : Optional [NotebookCoordinateMapper ],
357
- params : _TextDocumentCoordinatesParams ,
337
+ cell_uri : str ,
358
338
result : T ,
359
339
) -> T :
360
340
if isinstance (result , list ) and result and isinstance (result [0 ], Location ):
@@ -366,7 +346,7 @@ def _cell_results(
366
346
and result .range is not None
367
347
):
368
348
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 :
370
350
return cast (T , attrs .evolve (result , range = location .range ))
371
351
372
352
return result
@@ -392,7 +372,7 @@ def wrapped(ls: T_ls, params: T_params) -> T:
392
372
notebook_server = cast (T_ls , ServerWrapper (ls ))
393
373
result = f (notebook_server , notebook_params )
394
374
return _cell_results (
395
- notebook_server .workspace , mapper , notebook_params , result
375
+ notebook_server .workspace , mapper , params . text_document . uri , result
396
376
)
397
377
398
378
return wrapped
0 commit comments