Skip to content

Commit 5d67cbe

Browse files
committed
Use notification command links for debugger installation
1 parent 996e054 commit 5d67cbe

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

editors/code/src/debug.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ export async function startDebugSession(ctx: Ctx, runnable: ra.Runnable): Promis
6666
return vscode.debug.startDebugging(undefined, debugConfig);
6767
}
6868

69+
function createCommandLink(extensionId: string): string {
70+
// do not remove the second quotes inside
71+
// encodeURIComponent or it won't work
72+
return `extension.open?${encodeURIComponent(`"${extensionId}"`)}`;
73+
}
74+
6975
async function getDebugConfiguration(
7076
ctx: Ctx,
7177
runnable: ra.Runnable,
@@ -90,9 +96,12 @@ async function getDebugConfiguration(
9096
}
9197

9298
if (!debugEngine) {
99+
const commandCodeLLDB: string = createCommandLink("vadimcn.vscode-lldb");
100+
const commandCpp: string = createCommandLink("ms-vscode.cpptools");
101+
93102
await vscode.window.showErrorMessage(
94-
`Install [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)` +
95-
` or [MS C++ tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) extension for debugging.`,
103+
`Install [CodeLLDB](command:${commandCodeLLDB} "Open CodeLLDB")` +
104+
` or [C/C++](command:${commandCpp} "Open C/C++") extension for debugging.`,
96105
);
97106
return;
98107
}

0 commit comments

Comments
 (0)