MCPcopy Create free account
hub / github.com/Snapchat/Valdi / constructor

Method constructor

valdi/vscode_debugger/src/targets/node/nodeTarget.ts:46–67  ·  view source on GitHub ↗
(
    private readonly pathResolver: ISourcePathResolver,
    private readonly targetOriginValue: ITargetOrigin,
    public readonly connection: Connection,
    cdp: Cdp.Api,
    targetInfo: Cdp.Target.TargetInfo,
    public readonly logger: ILogger,
    private readonly lifecycle: INodeTargetLifecycleHooks = {},
  )

Source from the content-addressed store, hash-verified

44 public readonly onNameChanged = this._onNameChangedEmitter.event;
45
46 constructor(
47 private readonly pathResolver: ISourcePathResolver,
48 private readonly targetOriginValue: ITargetOrigin,
49 public readonly connection: Connection,
50 cdp: Cdp.Api,
51 targetInfo: Cdp.Target.TargetInfo,
52 public readonly logger: ILogger,
53 private readonly lifecycle: INodeTargetLifecycleHooks = {},
54 ) {
55 this.connection = connection;
56 this._cdp = cdp;
57 cdp.pause();
58 this._targetId = targetInfo.targetId;
59 this._scriptName = targetInfo.title;
60 this._waitingForDebugger = targetInfo.type === 'waitingForDebugger';
61 if (targetInfo.title)
62 this._targetName = `${basename(targetInfo.title)} [${targetInfo.targetId}]`;
63 else this._targetName = `[${targetInfo.targetId}]`;
64
65 cdp.Target.on('targetDestroyed', () => this.connection.close());
66 connection.onDisconnected(() => this._disconnected());
67 }
68
69 id(): string {
70 return this._targetId;

Callers

nothing calls this directly

Calls 5

_disconnectedMethod · 0.95
pauseMethod · 0.65
onMethod · 0.65
closeMethod · 0.65
onDisconnectedMethod · 0.45

Tested by

no test coverage detected