robotcode-debugger 2.8.0.dev677__py3-none-any.whl → 2.9.0.dev51__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- __version__ = "2.8.0-dev.677"
1
+ __version__ = "2.9.0-dev.51"
robotcode/debugger/cli.py CHANGED
@@ -145,8 +145,14 @@ def debug(
145
145
  robot_options_and_args: Tuple[str, ...],
146
146
  ) -> None:
147
147
  """Starts a Robot Framework debug session and waits for incomming connections."""
148
+ from robotcode.runner.cli.robot import load_robot_profile
149
+
148
150
  from .run import run_debugger
149
151
 
152
+ # Before the debug server starts, so that it runs under the `wrapper` too; an error
153
+ # of the configuration shows when `robot` runs in the debug session.
154
+ load_robot_profile(app, robot_options_and_args)
155
+
150
156
  mode, port, bind, pipe_name = resolve_server_options(
151
157
  ctx,
152
158
  app,
robotcode/debugger/run.py CHANGED
@@ -5,7 +5,9 @@ import threading
5
5
  import time
6
6
  from concurrent.futures import CancelledError
7
7
  from typing import (
8
+ IO,
8
9
  TYPE_CHECKING,
10
+ Any,
9
11
  Callable,
10
12
  List,
11
13
  Optional,
@@ -25,7 +27,7 @@ from robotcode.core.utils.debugpy import (
25
27
  )
26
28
  from robotcode.core.utils.logging import LoggingDescriptor
27
29
  from robotcode.core.utils.net import find_free_port
28
- from robotcode.plugin import Application
30
+ from robotcode.plugin import Application, UnknownError, show_error
29
31
 
30
32
  from .dap_types import Event
31
33
  from .debugger import Debugger
@@ -166,6 +168,19 @@ def _run_robot(ctx: click.Context, app: Application, args: List[str]) -> int:
166
168
  return 0
167
169
 
168
170
 
171
+ class _ShownError(click.ClickException):
172
+ """An error that `run_debugger` showed before the debug session ended. It keeps the
173
+ error's exit code and shows nothing, so the command shows the error only once."""
174
+
175
+ def __init__(self, error: click.ClickException) -> None:
176
+ super().__init__(error.message)
177
+ # click declares the exit code on the class; this one is the code of the error shown
178
+ self.exit_code = error.exit_code # type: ignore[misc]
179
+
180
+ def show(self, file: Optional[IO[Any]] = None) -> None:
181
+ pass
182
+
183
+
169
184
  @_logger.call
170
185
  def run_debugger(
171
186
  ctx: click.Context,
@@ -256,6 +271,16 @@ def run_debugger(
256
271
  exit_code = 0
257
272
  try:
258
273
  exit_code = _run_robot(ctx, app, args)
274
+ except CancelledError:
275
+ raise
276
+ except Exception as e:
277
+ # An error that stops the run, such as one of the configuration: shown
278
+ # while the session lasts, since the debug launcher forwards the output of
279
+ # the run to VS Code's Debug Console only until then. An error that is not
280
+ # robotcode's own is shown as `debug` shows it.
281
+ error = e if isinstance(e, click.ClickException) else UnknownError(str(e))
282
+ show_error(app, error)
283
+ raise _ShownError(error) from e
259
284
  finally:
260
285
  if server.protocol.connected:
261
286
  server.protocol.send_event(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: robotcode-debugger
3
- Version: 2.8.0-dev.677
3
+ Version: 2.9.0-dev.51
4
4
  Summary: RobotCode Debugger for Robot Framework
5
5
  Project-URL: Homepage, https://robotcode.io
6
6
  Project-URL: Donate, https://opencollective.com/robotcode
@@ -26,8 +26,8 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
26
26
  Classifier: Topic :: Utilities
27
27
  Classifier: Typing :: Typed
28
28
  Requires-Python: >=3.10
29
- Requires-Dist: robotcode-jsonrpc2==2.8.0-dev.677
30
- Requires-Dist: robotcode-runner==2.8.0-dev.677
29
+ Requires-Dist: robotcode-jsonrpc2==2.9.0-dev.51
30
+ Requires-Dist: robotcode-runner==2.9.0-dev.51
31
31
  Requires-Dist: robotframework>=5.0.0
32
32
  Provides-Extra: debugpy
33
33
  Requires-Dist: debugpy; extra == 'debugpy'
@@ -1,6 +1,6 @@
1
1
  robotcode/debugger/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- robotcode/debugger/__version__.py,sha256=0xyLlet74gxp40f05fA-fjXhAr2XdtEik3UuIJs6yAM,30
3
- robotcode/debugger/cli.py,sha256=Ql8SwCU8bJArvqEqvpmY8X-9SRYs86d-qKsPsyVln8k,6168
2
+ robotcode/debugger/__version__.py,sha256=68lI1Ud2IVxiSKwJTXlHsfwV7s6ASsCia4CPMEdJ8Ls,29
3
+ robotcode/debugger/cli.py,sha256=9wkuurbTt2W_NJbjzSS0_tSiclOgCdlWq7FjrlyeyTI,6445
4
4
  robotcode/debugger/dap_types.py,sha256=9Q_aR_VOXccvFA--X8cnbPyHuAf1XaFyMw7bpQkqXyw,26736
5
5
  robotcode/debugger/debugger.py,sha256=jW54s02qi2jA732ohj9Uqpj9cOU7xJqDMa_bLpxiqTc,87157
6
6
  robotcode/debugger/default_capabilities.py,sha256=vGfZuKAh7vsZiQVJeTpDfdrnV0jr4MQ0gtgb8XmPVME,1695
@@ -10,14 +10,14 @@ robotcode/debugger/listeners.py,sha256=COUDb8AXBtQQrZqI7bQl2QlbcG3AoWfIMNCp1VhSP
10
10
  robotcode/debugger/mixins.py,sha256=h2OpTO-ToWr7cImlclSCEKUJdcWm5Bg8XIRJHDHw9Yw,80
11
11
  robotcode/debugger/protocol.py,sha256=dx0Dehpc9rC9pjo5ZTay4AR7F2QaP2iCAiv4pta3ClU,12686
12
12
  robotcode/debugger/py.typed,sha256=bWew9mHgMy8LqMu7RuqQXFXLBxh2CRx0dUbSx-3wE48,27
13
- robotcode/debugger/run.py,sha256=5DCIdWVajg-Acbm0KuNyDwqsDggz4oRX9WwJRZERW5s,8616
13
+ robotcode/debugger/run.py,sha256=xzFp3MIf4uI6oFv5lIImJEjSG3-SdtAjtQR1rMFCCNo,9771
14
14
  robotcode/debugger/server.py,sha256=kK5RC5TDMSBXM4iAenhaBDb0fMPVxJSioqP0NXD6RHI,15532
15
15
  robotcode/debugger/launcher/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  robotcode/debugger/launcher/cli.py,sha256=riYOtKP7H0TYwVy5dYl2Vn1-yqqCO1u6O1P26lD3nHg,1798
17
17
  robotcode/debugger/launcher/client.py,sha256=8YZiC3171RLpXveJUSf2fAXUwUvQvmPZ3ZJPGrlmy6g,5545
18
18
  robotcode/debugger/launcher/run.py,sha256=Q85ue2_V13X6sqNE1Tm4IGcUMTgbdL3YaBTZGDj1xbQ,536
19
19
  robotcode/debugger/launcher/server.py,sha256=HcxLdmK_fZGkXZHRdU2zRsbZgWx9IeZ9oEQUa8OUTEU,15121
20
- robotcode_debugger-2.8.0.dev677.dist-info/METADATA,sha256=xlePiFJ6m5R6OHlkOWzj0HngNOM1MZPiibk0Oi0vjec,3000
21
- robotcode_debugger-2.8.0.dev677.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
22
- robotcode_debugger-2.8.0.dev677.dist-info/entry_points.txt,sha256=cf2AcgCYK41yJAfzBwOYkmdX1MaGFYFx3X7c0t6b4I8,48
23
- robotcode_debugger-2.8.0.dev677.dist-info/RECORD,,
20
+ robotcode_debugger-2.9.0.dev51.dist-info/METADATA,sha256=VTAndZKCJl0Hxmcqv5rI79-uFi0Gg-UGEdiTGFN2uOE,2997
21
+ robotcode_debugger-2.9.0.dev51.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
22
+ robotcode_debugger-2.9.0.dev51.dist-info/entry_points.txt,sha256=cf2AcgCYK41yJAfzBwOYkmdX1MaGFYFx3X7c0t6b4I8,48
23
+ robotcode_debugger-2.9.0.dev51.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.32.4
2
+ Generator: hatchling 1.33.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any