[Lldb-commits] [lldb] [lldb-dap] Refactoring DebugCommunication to improve test consistency. (PR #143818)
John Harrison via lldb-commits
lldb-commits at lists.llvm.org
Mon Jun 16 12:36:53 PDT 2025
================
@@ -10,17 +10,117 @@
import subprocess
import signal
import sys
+from dataclasses import dataclass
import threading
import time
-from typing import Any, Optional, Union, BinaryIO, TextIO
+from typing import (
+ IO,
+ Any,
+ Callable,
+ Dict,
+ List,
+ Optional,
+ Tuple,
+ TypeGuard,
+ TypeVar,
+ TypedDict,
+ Union,
+ BinaryIO,
+ TextIO,
+ Literal,
+ cast,
+)
## DAP type references
-Event = dict[str, Any]
-Request = dict[str, Any]
-Response = dict[str, Any]
+
+T = TypeVar("T")
+
+
+class Event(TypedDict):
+ type: Literal["event"]
+ seq: Literal[0]
+ event: str
+ body: Optional[dict]
+
+
+class Request(TypedDict):
+ type: Literal["request"]
+ seq: int
+ command: str
+ arguments: Optional[dict]
+
+
+class Response(TypedDict):
+ type: Literal["response"]
+ seq: Literal[0]
----------------
ashgti wrote:
Done.
https://github.com/llvm/llvm-project/pull/143818
More information about the lldb-commits
mailing list