================
@@ -0,0 +1,26 @@
+import * as vscode from "vscode";
+
+export interface CommandArgs {
+ command: string;
+}
+
+export class CommandTool implements vscode.LanguageModelTool<CommandArgs> {
+ async invoke(
+ options: vscode.LanguageModelToolInvocationOptions<CommandArgs>,
+ token: vscode.CancellationToken,
+ ): Promise<vscode.LanguageModelToolResult> {
+ const session = vscode.debug.activeDebugSession;
+ if (session === undefined) {
+ return new vscode.LanguageModelToolResult([
+ new vscode.LanguageModelTextPart("Error: no debug session is active"),
+ ]);
+ }
+ const response = await session.customRequest("evaluate", {
+ expression: options.input.command,
+ context: "repl",
----------------
ashgti wrote:
We could use a custom context for this request (or an empty context) so it
doesn't interfere with the existing repl.
https://github.com/llvm/llvm-project/pull/174343
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits