Skip to content

Commit 5007396

Browse files
author
Paul van Brenk
committed
PR feedback
1 parent 9e03b4c commit 5007396

File tree

2 files changed

+41
-8
lines changed

2 files changed

+41
-8
lines changed

Nodejs/Product/Nodejs/Debugger/NodeDebugger.cs

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,15 @@ public NodeDebugger(Uri debuggerEndpointUri, int id)
8383
_attached = true;
8484
}
8585

86-
public NodeDebugger(string exe, string script, string dir, string env, string interpreterOptions, NodeDebugOptions debugOptions, ushort? debuggerPort = null, bool createNodeWindow = true)
86+
public NodeDebugger(
87+
string exe,
88+
string script,
89+
string dir,
90+
string env,
91+
string interpreterOptions,
92+
NodeDebugOptions debugOptions,
93+
ushort? debuggerPort = null,
94+
bool createNodeWindow = true)
8795
: this() {
8896
// Select debugger port for a local connection
8997
var debuggerPortOrDefault = debuggerPort ?? GetDebuggerPort();
@@ -105,7 +113,15 @@ private static ushort GetDebuggerPort() {
105113
return debuggerPortOrDefault;
106114
}
107115

108-
public static NodeProcess StartNodeProcessWithDebug(string exe, string script, string dir, string env, string interpreterOptions, NodeDebugOptions debugOptions, ushort? debuggerPort = null, bool createNodeWindow = true) {
116+
public static NodeProcess StartNodeProcessWithDebug(
117+
string exe,
118+
string script,
119+
string dir,
120+
string env,
121+
string interpreterOptions,
122+
NodeDebugOptions debugOptions,
123+
ushort? debuggerPort = null,
124+
bool createNodeWindow = true) {
109125
// Select debugger port for a local connection
110126
var debuggerPortOrDefault = debuggerPort ?? GetDebuggerPort();
111127

@@ -115,7 +131,15 @@ public static NodeProcess StartNodeProcessWithDebug(string exe, string script, s
115131
return StartNodeProcess(exe, dir, env, debugOptions, debuggerPortOrDefault, allArgs, createNodeWindow);
116132
}
117133

118-
public static NodeProcess StartNodeProcessWithInspect(string exe, string script, string dir, string env, string interpreterOptions, NodeDebugOptions debugOptions, ushort? debuggerPort = null, bool createNodeWindow = true) {
134+
public static NodeProcess StartNodeProcessWithInspect(
135+
string exe,
136+
string script,
137+
string dir,
138+
string env,
139+
string interpreterOptions,
140+
NodeDebugOptions debugOptions,
141+
ushort? debuggerPort = null,
142+
bool createNodeWindow = true) {
119143
// Select debugger port for a local connection
120144
var debuggerPortOrDefault = debuggerPort ?? GetDebuggerPort();
121145

@@ -126,7 +150,15 @@ public static NodeProcess StartNodeProcessWithInspect(string exe, string script,
126150
}
127151

128152
// starts the nodeprocess in debug mode without hooking up our debugger, this way we can attach the WebKit debugger as a next step.
129-
private static NodeProcess StartNodeProcess(string exe, string dir, string env, NodeDebugOptions debugOptions, ushort debuggerPortOrDefault, string allArgs, bool createNodeWindow) {
153+
private static NodeProcess StartNodeProcess(
154+
string exe,
155+
string dir,
156+
string env,
157+
NodeDebugOptions
158+
debugOptions,
159+
ushort debuggerPortOrDefault,
160+
string allArgs,
161+
bool createNodeWindow) {
130162
var psi = new ProcessStartInfo(exe, allArgs) {
131163
CreateNoWindow = !createNodeWindow,
132164
WorkingDirectory = dir,

Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ private void StartAndAttachDebugger(string file, string nodePath) {
9595

9696
// start the node process
9797
var workingDir = _project.GetWorkingDirectory();
98-
var env = "";
98+
var url = GetFullUrl();
99+
var env = GetEnvironmentVariablesString(url);
99100
var interpreterOptions = _project.GetProjectProperty(NodeProjectProperty.NodeExeArguments);
100101
var debugOptions = this.GetDebugOptions();
101102

@@ -159,11 +160,11 @@ private static IntPtr MarshalDebugEngines(Guid[] debugEngines) {
159160
return IntPtr.Zero;
160161
}
161162

162-
var guiSize = Marshal.SizeOf(typeof(Guid));
163-
var size = debugEngines.Length * guiSize;
163+
var guidSize = Marshal.SizeOf(typeof(Guid));
164+
var size = debugEngines.Length * guidSize;
164165
var bytes = new byte[size];
165166
for (var i = 0; i < debugEngines.Length; ++i) {
166-
debugEngines[i].ToByteArray().CopyTo(bytes, i * guiSize);
167+
debugEngines[i].ToByteArray().CopyTo(bytes, i * guidSize);
167168
}
168169

169170
var pDebugEngines = Marshal.AllocCoTaskMem(size);

0 commit comments

Comments
 (0)