Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ptvsd.adapter should support debugServer in launch.json #1556

Closed
int19h opened this issue Jul 2, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@int19h
Copy link
Contributor

commented Jul 2, 2019

ptvsd.adapter package currently only communicates with the IDE over stdin/out, as is usual for DAP. However, this is inconvenient for testing and debugging, since it requires it to be registered as a debugger extension with VSCode.

To simply this, we can use the debugServer option that VSCode provides in launch.json, whereby it connects to an already-running debug adapter over the specified port: https://vscode.readthedocs.io/en/latest/editor/debugging/#launchjson-attributes

This requires the adapter to support an incoming socket connection. It does not need to be a true server - it only has to listen for and accept a single connection, at the very beginning, where it currently does this:

def main():
import ptvsd
from ptvsd.common import log
from ptvsd.adapter import channels
log.to_file()
chan = channels.Channels()
chan.connect_to_ide()

Since it still needs to work in stdin/out mode by default, this should be configurable via a command line switch that accepts the port number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.