Skip to content

Commit 9d356c3

Browse files
authored
Have lldb-dap extension support multi-root workspace (llvm#142470)
- Allow running when no workspace folder is present, and do not override the `cwd` set in the launch configuration - Support getting configuration from workspace file Fixes llvm#142469
1 parent dd5204d commit 9d356c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export async function createDebugAdapterExecutable(
169169
workspaceFolder: vscode.WorkspaceFolder | undefined,
170170
configuration: vscode.DebugConfiguration,
171171
): Promise<vscode.DebugAdapterExecutable> {
172-
const config = vscode.workspace.getConfiguration("lldb-dap", workspaceFolder);
172+
const config = vscode.workspace.workspaceFile ? vscode.workspace.getConfiguration("lldb-dap") : vscode.workspace.getConfiguration("lldb-dap", workspaceFolder);
173173
const log_path = config.get<string>("log-path");
174174
let env: { [key: string]: string } = {};
175175
if (log_path) {
@@ -184,7 +184,7 @@ export async function createDebugAdapterExecutable(
184184
...configEnvironment,
185185
...env,
186186
},
187-
cwd: workspaceFolder!!.uri.fsPath,
187+
cwd: configuration.cwd ?? workspaceFolder?.uri.fsPath,
188188
};
189189
const dbgArgs = await getDAPArguments(workspaceFolder, configuration);
190190

0 commit comments

Comments
 (0)