| 1 |
import * as vscode from "vscode"; |
| 2 |
import { LLDBDapOptions } from "./types"; |
| 3 |
|
| 4 |
/** |
| 5 |
* This class defines a factory used to find the lldb-dap binary to use |
| 6 |
* depending on the session configuration. |
| 7 |
*/ |
| 8 |
export class LLDBDapDescriptorFactory |
| 9 |
implements vscode.DebugAdapterDescriptorFactory |
| 10 |
{ |
| 11 |
private lldbDapOptions: LLDBDapOptions; |
| 12 |
|
| 13 |
constructor(lldbDapOptions: LLDBDapOptions) { |
| 14 |
this.lldbDapOptions = lldbDapOptions; |
| 15 |
} |
| 16 |
|
| 17 |
async createDebugAdapterDescriptor( |
| 18 |
session: vscode.DebugSession, |
| 19 |
executable: vscode.DebugAdapterExecutable | undefined, |
| 20 |
): Promise<vscode.DebugAdapterDescriptor | undefined> { |
| 21 |
return this.lldbDapOptions.createDapExecutableCommand(session, executable); |
| 22 |
} |
| 23 |
} |