MCPcopy
hub / github.com/microsoft/vscode-js-debug / launch

Method launch

src/vsDebugServer.ts:95–127  ·  view source on GitHub ↗
(
    parentSession: Session<VSDebugSession>,
    target: ITarget,
    config: IPseudoAttachConfiguration,
  )

Source from the content-addressed store, hash-verified

93 }
94
95 public launch(
96 parentSession: Session<VSDebugSession>,
97 target: ITarget,
98 config: IPseudoAttachConfiguration,
99 ): void {
100 const childAttachConfig = { ...config, sessionId: target.id, __jsDebugChildServer: '' };
101 const deferredConnection: IDeferred<DapConnection> = getDeferred();
102 const session = new VSDebugSession(
103 target.id(),
104 target.name(),
105 deferredConnection.promise,
106 childAttachConfig,
107 );
108
109 this.sessionServer.createChildDebugServer(session, 0).then(
110 ({ server, connectionPromise }) => {
111 connectionPromise.then(x => deferredConnection.resolve(x));
112 childAttachConfig.__jsDebugChildServer = (
113 server.address() as net.AddressInfo
114 ).port.toString();
115
116 // Custom message currently not part of DAP
117 parentSession.connection._send({
118 seq: 0,
119 command: 'attachedChildSession',
120 type: 'request',
121 arguments: {
122 config: childAttachConfig,
123 },
124 });
125 },
126 );
127 }
128}
129
130let debugServerPort: number | undefined = undefined;

Callers

nothing calls this directly

Calls 7

getDeferredFunction · 0.90
resolveMethod · 0.80
idMethod · 0.65
nameMethod · 0.65
toStringMethod · 0.45
_sendMethod · 0.45

Tested by

no test coverage detected