Skip to content

Commit be0484c

Browse files
committed
Address more review comments
1 parent b315e09 commit be0484c

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

lldb/tools/lldb-dap/README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,17 @@ The default hostname being used `localhost`.
178178

179179
Debugging sessions can also be starting using special URIs.
180180

181-
The `vscode://llvm-vs-code-extensions.lldb-dap/launch/config?config={launch-config}`
181+
The `vscode://llvm-vs-code-extensions.lldb-dap/start?config={launch-config}`
182182
URI accepts a [URL-encoded](https://en.wikipedia.org/wiki/Percent-encoding)
183183
JSON launch config.
184184

185185
This is useful for integration with custom scripts to start debugging
186186
sessions. The URI might be printed to the terminal, potentially using
187187
[OSC-8 hyperlinks](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda),
188-
or passed to `vscode --open-url` or `xdg-open`, although mileage may vary
189-
depending on your specific debugging setup.
188+
or passed to `code --open-url` or `xdg-open`, although mileage may vary depending
189+
on your specific debugging setup. E.g., `code --open-url` will not work when using a
190+
SSH remote session. Furthermore, placeholders such as `${workspaceFolder}` are not
191+
supported within launch URLs.
190192

191193
### Configuration Settings Reference
192194

lldb/tools/lldb-dap/src-ts/uri-launch-handler.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export class LaunchUriHandler implements vscode.UriHandler {
44
async handleUri(uri: vscode.Uri) {
55
try {
66
const params = new URLSearchParams(uri.query);
7-
if (uri.path == '/launch/config') {
7+
if (uri.path == '/start') {
88
const configJson = params.get("config");
99
if (configJson === null) {
1010
throw new Error("Missing `config` URI parameter");
@@ -16,7 +16,8 @@ export class LaunchUriHandler implements vscode.UriHandler {
1616
name: '',
1717
};
1818
Object.assign(debugConfig, JSON.parse(configJson));
19-
debugConfig.name = debugConfig.name || debugConfig.program || "Adhoc Launch";
19+
const defaultName = debugConfig.request == 'launch' ? "URL-based Launch" : "URL-based Attach";
20+
debugConfig.name = debugConfig.name || debugConfig.program || defaultName;
2021
// Force the type to `lldb-dap`. We don't want to allow launching any other
2122
// Debug Adapters using this URI scheme.
2223
if (debugConfig.type != "lldb-dap") {
@@ -30,8 +31,8 @@ export class LaunchUriHandler implements vscode.UriHandler {
3031
if (err instanceof Error) {
3132
await vscode.window.showErrorMessage(`Failed to handle lldb-dap URI request: ${err.message}`);
3233
} else {
33-
await vscode.window.showErrorMessage(`Failed to handle lldb-dap URI request`);
34+
await vscode.window.showErrorMessage(`Failed to handle lldb-dap URI request: ${JSON.stringify(err)}`);
3435
}
3536
}
3637
}
37-
}
38+
}

0 commit comments

Comments
 (0)