+
    8LiA  ã                   óê   € R t ^ RIt^ RIHt ^ RIHtHtHtHt ^ RI	H
t
 ]P                  ! ]4      t]P                  ]P                  ]P                   uttt]R	,          t ! R R4      t ! R R4      tR# )
z=Asynchronous msgpack-rpc handling in the event loop pipeline.N)Ú
format_exc)ÚAnyÚAnyStrÚCallableÚDict©ÚMsgpackStreamc                   ó„   a € ] tR t^t o RtV 3R lR ltR tV 3R lR ltR tR t	R	 t
R
 tR tR tR tR tR tRtV tR# )ÚAsyncSessionzæAsynchronous msgpack-rpc layer that wraps a msgpack stream.

This wraps the msgpack stream interface for reading/writing msgpack
documents and exposes an interface for sending and receiving msgpack-rpc
requests and notifications.
c                ó    <€ V ^8„  d   QhRS[ /# )é   Úmsgpack_streamr   )ÚformatÚ__classdict__s   "€ÚB/usr/lib/python3/dist-packages/pynvim/msgpack_rpc/async_session.pyÚ__annotate__ÚAsyncSession.__annotate__   s   ø€ ÷ (ñ (¡}ñ (ó    c                óÂ   € Wn         ^V n        / V n        R;V n        V n        ^ V P
                  ^V P                  ^V P                  /V n        VP                  V n	        R# )z1Wrap `msgpack_stream` on a msgpack-rpc interface.N)
Ú_msgpack_streamÚ_next_request_idÚ_pending_requestsÚ_request_cbÚ_notification_cbÚ_on_requestÚ_on_responseÚ_on_notificationÚ	_handlersÚloop)Úselfr   s   &&r   Ú__init__ÚAsyncSession.__init__   sa   € à-ÔØ !ˆÔØ>@ˆÔØ37Ð7ˆÔ˜4Ô0àˆt×ÑØˆt× Ñ Øˆt×$Ñ$ð
ˆŒð
 #×'Ñ'ˆŽ	r   c                ó<   € V P                   P                  V4       R# )z/Wrapper around `MsgpackStream.threadsafe_call`.N)r   Úthreadsafe_call)r   Úfns   &&r   r#   ÚAsyncSession.threadsafe_call&   s   € à×Ñ×,Ñ,¨RÖ0r   c                ó0   <€ V ^8„  d   QhRS[ RS[RS[RR/# )r   ÚmethodÚargsÚresponse_cbÚreturnN)r   r   ÚResponseCallback)r   r   s   "€r   r   r   *   s+   ø€ ÷ 9ñ 9™fð 9©Cð 9Ù-ð9Ø26ñ9r   c                ó’   € V P                   pV^,           V n         V P                  P                  ^ WAV.4       W0P                  V&   R# )z·Send a msgpack-rpc request to Nvim.

A msgpack-rpc with method `method` and argument `args` is sent to
Nvim. The `response_cb` function is called with when the response
is available.
N)r   r   Úsendr   )r   r'   r(   r)   Ú
request_ids   &&&& r   ÚrequestÚAsyncSession.request*   sD   € ð ×*Ñ*ˆ
Ø *¨Q¥ˆÔØ×Ñ×!Ñ! 1 j¸$Ð"?Ô@Ø-8×Ñ˜zÓ*r   c                ó@   € V P                   P                  ^W.4       R# )zÀSend a msgpack-rpc notification to Nvim.

A msgpack-rpc with method `method` and argument `args` is sent to
Nvim. This will have the same effect as a request, but no response
will be received
N©r   r-   )r   r'   r(   s   &&&r   ÚnotifyÚAsyncSession.notify7   s   € ð 	×Ñ×!Ñ! 1 fÐ"3Ö4r   c                ó„   € Wn         W n        V P                  P                  V P                  4       RV n         RV n        R# )z×Run the event loop to receive requests and notifications from Nvim.

While the event loop is running, `request_cb` and `notification_cb`
will be called whenever requests or notifications are respectively
available.
N)r   r   r   ÚrunÚ_on_message)r   Ú
request_cbÚnotification_cbs   &&&r   r6   ÚAsyncSession.run@   s:   € ð &ÔØ /ÔØ×Ñ× Ñ  ×!1Ñ!1Ô2ØˆÔØ $ˆÖr   c                ó:   € V P                   P                  4        R# )zStop the event loop.N)r   Ústop©r   s   &r   r<   ÚAsyncSession.stopM   s   € à×Ñ×!Ñ!Ö#r   c                ó:   € V P                   P                  4        R# )zClose the event loop.N)r   Úcloser=   s   &r   r@   ÚAsyncSession.closeQ   s   € à×Ñ×"Ñ"Ö$r   c                óè   €  V P                   P                  V^ ,          V P                  4      ! V4       R#   \         d0    \	        ^4      p T P
                  P                  ^^ TR.4        R# i ; i)é    N)r   ÚgetÚ_on_invalid_messageÚ	Exceptionr   r   r-   )r   ÚmsgÚerr_strs   && r   r7   ÚAsyncSession._on_messageU   sb   € ð	=ØN‰N×Ñ˜s 1v t×'?Ñ'?Ô@ÀÖEøÜô 	=Ü  “mˆGØà× Ñ ×%Ñ% q¨!¨W°dÐ&;×<ð		=ús   ‚37 ·6A1Á0A1c           	     ó    €  V P                   f   Q hV P                  V^,          V^,          \        V P                  V^,          4      4       R # ©N)r   ÚResponser   ©r   rG   s   &&r   r   ÚAsyncSession._on_request^   sH   € ð
 	à×ÑÒ+Ð+Ð+Ø×Ñ˜˜Q  Q¥Ü! $×"6Ñ"6¸¸A½Ó?ö	Ar   c                óv   €  V P                   P                  V^,          4      ! V^,          V^,          4       R# )é   N)r   ÚpoprM   s   &&r   r   ÚAsyncSession._on_responsei   s.   € ð
 	à×Ñ×"Ñ" 3 q¥6Ô*¨3¨q­6°3°qµ6Ö:r   c                óh   €  V P                   f   Q hV P                  V^,          V^,          4       R # rK   )r   rM   s   &&r   r   ÚAsyncSession._on_notificationr   s1   € ð 	à×$Ñ$Ò0Ð0Ð0Ø×Ñ˜c !f c¨!¥fÖ-r   c                óX   € R V,          p V P                   P                  ^^ VR.4       R# )zReceived invalid message %sNr2   )r   rG   Úerrors   && r   rE   Ú AsyncSession._on_invalid_message{   s,   € Ø-°Õ3ˆØà×Ñ×!Ñ! 1 a¨°Ð"5Ö6r   )r   r   r   r   r   r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r    r#   r/   r3   r6   r<   r@   r7   r   r   r   rE   Ú__static_attributes__Ú__classdictcell__©r   s   @r   r
   r
      sV   ø‡ € ñ÷(ð (ò1÷9ð 9ò5ò%ò$ò%ò=ò	Aò;ò.÷7ð 7r   r
   c                   ó@   a € ] tR t^‚t o RtV 3R lR ltRR ltRtV tR# )rL   z·Response to a msgpack-rpc request that came from Nvim.

When Nvim sends a msgpack-rpc request, an instance of this class is
created for remembering state required to send a response.
c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   r   r.   )r   Úint)r   r   s   "€r   r   ÚResponse.__annotate__‰   s   ø€ ÷ &ñ &¡}ð &Á#ñ &r   c                ó   € Wn         W n        R# )z!Initialize the Response instance.N©r   Ú_request_id)r   r   r.   s   &&&r   r    ÚResponse.__init__‰   s   € à-ÔØ%Ör   c                ó   € V'       d   ^V P                   VR.pM^V P                   RV.p V P                  P                  V4       R# )zESend the response.

If `error` is True, it will be sent as an error.
N)rf   r   r-   )r   ÚvaluerV   Úresps   &&& r   r-   ÚResponse.sendŽ   sF   € ÷
 Øt×'Ñ'¨°Ð5‰Dàt×'Ñ'¨¨uÐ5ˆDØà×Ñ×!Ñ! $Ö'r   re   N)F)	rX   rY   rZ   r[   r\   r    r-   r]   r^   r_   s   @r   rL   rL   ‚   s   ø‡ € ñ÷&ð &÷
(ò (r   rL   ).N)r\   ÚloggingÚ	tracebackr   Útypingr   r   r   r   Ú!pynvim.msgpack_rpc.msgpack_streamr   Ú	getLoggerrX   ÚloggerÚdebugÚinfoÚwarningÚwarnr+   r
   rL   © r   r   Ú<module>rw      sg   ðÙ CÛ Ý  ß .Ó .å ;à	×	Ò	˜8Ó	$€Ø—\‘\ 6§;¡;°·±Ð €€tˆTð ˜IÕ&Ð ÷o7ñ o7÷d(ó (r   