Skip to content

Commit

Permalink
It's possible to specify the protocol used in pydevd.settrace (to sup…
Browse files Browse the repository at this point in the history
…port dap).
  • Loading branch information
fabioz committed Feb 25, 2024
1 parent eb81bc7 commit af08eb5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pydevd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2937,6 +2937,7 @@ def settrace(
access_token=None,
client_access_token=None,
notify_stdin=True,
protocol=None,
**kwargs,
):
"""Sets the tracing function with the pydev debug function and initializes needed facilities.
Expand Down Expand Up @@ -2991,7 +2992,14 @@ def settrace(
as an input to the process or as a command to be evaluated.
Note that parallel-python has issues with this (because it tries to assert that sys.stdin
is of a given type instead of just checking that it has what it needs).
:param protocol:
When using in Eclipse the protocol should not be passed, but when used in VSCode
or some other IDE/editor that accepts the Debug Adapter Protocol then 'dap' should
be passed.
"""
if protocol and protocol.lower() == "dap":
pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = pydevd_constants.HTTP_JSON_PROTOCOL

stdout_to_server = stdout_to_server or kwargs.get("stdoutToServer", False) # Backward compatibility
stderr_to_server = stderr_to_server or kwargs.get("stderrToServer", False) # Backward compatibility
Expand Down

0 comments on commit af08eb5

Please sign in to comment.