Skip to content

Commit

Permalink
Add trace for pid and dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Apr 19, 2024
1 parent d23c1d4 commit b1fab07
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/HLAdapter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,8 @@ class HLAdapter extends DebugSession {
js.Node.process.env.set('LIBHL_PATH', js.node.Path.dirname(args.hl));
}

debug("Start process " + hlPath + " " + hlArgs);

proc = ChildProcess.spawn(hlPath, hlArgs, {cwd: args.cwd, env:args.env});
debug("Start process " + hlPath + " " + hlArgs + " pid=" + proc.pid);
proc.stdout.setEncoding('utf8');
var prev = "";
proc.stdout.on('data', function(buf) {
Expand Down Expand Up @@ -1062,6 +1061,13 @@ class HLAdapter extends DebugSession {
override function completionsRequest(response:CompletionsResponse, args:CompletionsArguments) { debug("Unhandled request"); }
override function setExpressionRequest(response:SetExpressionResponse, args:SetExpressionArguments) { debug("Unhandled request"); }

override function dispose() {
super.dispose();
debug("Dispose");
inst = null;
return null;
}

function sendToOutput(output:String, category:OutputEventCategory = Console) {
sendEvent(new OutputEvent(output + "\n", category));
}
Expand Down

0 comments on commit b1fab07

Please sign in to comment.