================ @@ -137,53 +157,59 @@ export class LLDBDapDescriptorFactory const dbgOptions = { env: { - ...executable?.options?.env, ...configEnvironment, ...env, }, }; - const dbgArgs = executable?.args ?? []; + const dbgArgs = getDAPArguments(session); - const serverMode = config.get<boolean>('serverMode', false); + const serverMode = config.get<boolean>("serverMode", false); if (serverMode) { - const { host, port } = await this.startServer(dapPath, dbgArgs, dbgOptions); + const { host, port } = await this.startServer( + dapPath, + dbgArgs, + dbgOptions, + ); return new vscode.DebugAdapterServer(port, host); } return new vscode.DebugAdapterExecutable(dapPath, dbgArgs, dbgOptions); } - startServer(dapPath: string, args: string[], options: child_process.CommonSpawnOptions): Promise<{ host: string, port: number }> { - if (this.server) return this.server; + startServer( + dapPath: string, + args: string[], + options: child_process.CommonSpawnOptions, + ): Promise<{ host: string; port: number }> { + if (this.server) { + return this.server; + } ---------------- ashgti wrote:
We could prompt the user to ask if they want to stop the running server and start a new server, something like: ``` const stopOption = "Stop running lldb-dap server"; const reuseOption = "Use existing lldb-dap server"; const userInput = await vscode.window.showInformationMessage( "An instance of lldb-dap is already running, would you like to stop the running instance or reuse the existing instance?", { modal: true }, stopOption, reuseOption, ); if (!userInput) { return undefined; // This should open the debug configuration } if (userInput == stopOption) { ... } else { ... } ``` https://github.com/llvm/llvm-project/pull/129262 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits