Commit 57fbf69
Make the DAP server's
Summary:
The `tintype_dap_server` CLI's positional `pytb_file` argument was a redundant pre-flight check duplicating logic that already lives in the DAP `launch` handler. The path the server actually opens is the one in the `launch` request body (`arguments.pytbPath`), which `SnapshotDebugSession.handle_launch` validates (`os.path.isfile`) and hands to `SnapshotReader` — the CLI's copy is discarded after the `os.path.isfile` fast-fail.
This diff relaxes the positional to `nargs="?"` and gates the existence check on a non-`None` value. Callers that still pass the path get the same fast-fail UX as before; callers that don't (the VS Code extension is about to stop doing so — see the next diff in the stack) let `handle_launch` validate.
Everything downstream is unchanged: `serve()` / `run_session_on_stdio()` never received the path, `handle_launch` continues to require `arguments.pytbPath`, the outer Meta wrapper (`fbcode/tintype/fb/tintype_dap_server.py`) and the `--show-runtime-path(s)` short-circuit don't inspect `pytb_file`.
Reviewed By: aperez
Differential Revision: D106546434
fbshipit-source-id: c2c0d59aef1d097c79ffda0f2eb3291c761f2411pytb_file CLI argument optional1 parent f4a98c4 commit 57fbf69
2 files changed
Lines changed: 52 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
95 | 102 | | |
96 | 103 | | |
97 | 104 | | |
| |||
114 | 121 | | |
115 | 122 | | |
116 | 123 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
121 | 131 | | |
122 | 132 | | |
123 | 133 | | |
124 | 134 | | |
125 | 135 | | |
126 | | - | |
127 | | - | |
| 136 | + | |
| 137 | + | |
128 | 138 | | |
129 | 139 | | |
130 | 140 | | |
131 | 141 | | |
132 | 142 | | |
133 | | - | |
| 143 | + | |
134 | 144 | | |
135 | 145 | | |
136 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| |||
114 | 121 | | |
115 | 122 | | |
116 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
117 | 151 | | |
118 | 152 | | |
119 | 153 | | |
| |||
0 commit comments