Format: application/x-python-code
1 o
2
3 ��h� � @ sh d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl Z ddl
4 Z
5 ddlmZm
6 Z
7 mZ ddlmZ G dd� de�ZG dd � d ee�ZG d
8 d� de�ZG dd
9 � d
10 ej�Zdd� ZG dd� de�ZG dd� de�Ze� Z G dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Z G dd� de!�Z"G dd� de"�Z#G d d!� d!e�Z$G d"d#� d#e�Z%dS )$z�An implementation of the session and presentation layers as used in the Debug
11 Adapter Protocol (DAP): channels and their lifetime, JSON messages, requests,
12 responses, and events.
13
14 https://microsoft.github.io/debug-adapter-protocol/overview#base-protocol
15 � )�annotationsN)�json�log�util)�hide_thread_from_debuggerc � e Zd ZdZ� fdd�Z� ZS )�JsonIOErrorzDIndicates that a read or write operation on JsonIOStream has failed.c sT |� d�}|� dd �}t|�s|d urt|�g}t� j|i |�� || _ || _d S )N�stream�cause)�pop�len�str�super�__init__r r
16 )�self�args�kwargsr r
17 �� __class__� �Nc:\Users\shubh\Videos\agent\nova\Lib\site-packages\debugpy/common/messaging.pyr s
18
19 zJsonIOError.__init__��__name__�
20 __module__�__qualname__�__doc__r �
21 __classcell__r r r r r s r c r )�NoMoreMessagesz`Indicates that there are no more messages that can be read from or written
22 to a stream.
23 c s( t |�r|ndg}t� j|i |�� d S )NzNo more messages)r r r �r r r r r r r 7 s zNoMoreMessages.__init__r r r r r r 2 s r c @ s� e Zd ZdZdZejZ ejZ e
24 ddd��Ze
25 ddd��Ze
26 dd d
27 ��Z
28 ddd� fd
29 d�Zdd� Zejfdd�Zdd� Zddd�Zddd�Zdd� ZdS )�JsonIOStreamz�Implements a JSON value stream over two byte streams (input and output).
30
31 Each value is encoded as a DAP packet, with metadata headers and a JSON payload.
32 i��� �stdioc C s | t jjt jj|�S )zlCreates a new instance that receives messages from sys.stdin, and sends
33 them to sys.stdout.
34 )�sys�stdin�buffer�stdout)�cls�namer r r �
35 from_stdioJ s zJsonIOStream.from_stdioc C s | |j |j|�S )ztCreates a new instance that receives messages from process.stdin, and sends
36 them to process.stdout.
37 )r$ r"