@@ -435,29 +435,6 @@ async def handler(req: types.CompleteRequest):
435435
436436 return decorator
437437
438- async def _handle_message (
439- self ,
440- message : RequestResponder [types .ClientRequest , types .ServerResult ]
441- | types .ClientNotification
442- | Exception ,
443- session : ServerSession ,
444- raise_exceptions : bool = False ,
445- ):
446- with warnings .catch_warnings (record = True ) as w :
447- match message :
448- case (
449- RequestResponder (request = types .ClientRequest (root = req )) as responder
450- ):
451- with responder :
452- await self ._handle_request (
453- message , req , session , raise_exceptions
454- )
455- case types .ClientNotification (root = notify ):
456- await self ._handle_notification (notify )
457-
458- for warning in w :
459- logger .info (f"Warning: { warning .category .__name__ } : { warning .message } " )
460-
461438 async def run (
462439 self ,
463440 read_stream : MemoryObjectReceiveStream [types .JSONRPCMessage | Exception ],
@@ -483,6 +460,29 @@ async def run(
483460 raise_exceptions ,
484461 )
485462
463+ async def _handle_message (
464+ self ,
465+ message : RequestResponder [types .ClientRequest , types .ServerResult ]
466+ | types .ClientNotification
467+ | Exception ,
468+ session : ServerSession ,
469+ raise_exceptions : bool = False ,
470+ ):
471+ with warnings .catch_warnings (record = True ) as w :
472+ match message :
473+ case (
474+ RequestResponder (request = types .ClientRequest (root = req )) as responder
475+ ):
476+ with responder :
477+ await self ._handle_request (
478+ message , req , session , raise_exceptions
479+ )
480+ case types .ClientNotification (root = notify ):
481+ await self ._handle_notification (notify )
482+
483+ for warning in w :
484+ logger .info (f"Warning: { warning .category .__name__ } : { warning .message } " )
485+
486486 async def _handle_request (
487487 self ,
488488 message : RequestResponder ,
0 commit comments