Skip to content

Commit

Permalink
Use cwd from runnable.args for debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
roife committed May 23, 2024
1 parent 7b54c82 commit 1a37cfb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tools/rust-analyzer/editors/code/src/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function getCCppDebugConfig(
name: runnable.label,
program: executable,
args: runnable.args.executableArgs,
cwd: runnable.args.workspaceRoot,
cwd: runnable.args.cwd || runnable.args.workspaceRoot || ".",
sourceFileMap,
env,
// See https://github.com/rust-lang/rust-analyzer/issues/16901#issuecomment-2024486941
Expand All @@ -214,7 +214,7 @@ function getCodeLldbDebugConfig(
name: runnable.label,
program: executable,
args: runnable.args.executableArgs,
cwd: runnable.args.workspaceRoot,
cwd: runnable.args.cwd || runnable.args.workspaceRoot || ".",
sourceMap: sourceFileMap,
sourceLanguages: ["rust"],
env,
Expand All @@ -234,7 +234,7 @@ function getNativeDebugConfig(
target: executable,
// See https://github.com/WebFreak001/code-debug/issues/359
arguments: quote(runnable.args.executableArgs),
cwd: runnable.args.workspaceRoot,
cwd: runnable.args.cwd || runnable.args.workspaceRoot || ".",
env,
valuesFormatting: "prettyPrinters",
};
Expand Down
1 change: 1 addition & 0 deletions src/tools/rust-analyzer/editors/code/src/lsp_ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export type Runnable = {
kind: "cargo";
args: {
workspaceRoot?: string;
cwd?: string;
cargoArgs: string[];
cargoExtraArgs: string[];
executableArgs: string[];
Expand Down

0 comments on commit 1a37cfb

Please sign in to comment.