Skip to content

Commit

Permalink
Add comments re: we use only DebugAdapterServer
Browse files Browse the repository at this point in the history
  • Loading branch information
noppej committed Nov 17, 2021
1 parent da8154a commit 854832f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,13 @@ class ProbeRSDebugAdapterServerDescriptorFactory implements vscode.DebugAdapterD
}
}

// Note. We do NOT use `DebugAdapterExecutable`, but instead use `DebugAdapterServer` in all cases.
// - The decision was made during investigation of an [issue](https://github.com/probe-rs/probe-rs/issues/703) ... basically, after the probe-rs API was fixed, the code would work well for TCP connections (`DebugAdapterServer`), but would not work for STDIO connections (`DebugAdapterServer`). After some searches I found other extension developers that also found the TCP based connections to be more stable.
// - Since then, we have taken advantage of the access to stderr that `DebugAdapterServer` offers to route `RUST_LOG` output from the debugger to the user's VSCode Debug Console. This is a very useful capability, and cannot easily be implemented in `DebugAdapterExecutable`, because it does not allow access to `stderr` [See ongoing issue in VScode repo](https://github.com/microsoft/vscode/issues/108145).
async createDebugAdapterDescriptor(session: vscode.DebugSession, executable: vscode.DebugAdapterExecutable | undefined): Promise<vscode.DebugAdapterDescriptor | null | undefined> {
probeRsLogLevel = session.configuration.consoleLogLevel;

// Initiate either the 'attach' or 'launch' request.
// We do NOT use DebugAdapterExecutable
logToConsole("INFO: Session: " + JSON.stringify(session, null, 2));

// When starting the debugger process, we have to wait for debuggerStatus to be set to `DebuggerStatus.running` before we continue
Expand Down

0 comments on commit 854832f

Please sign in to comment.