aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/run.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/run.ts')
-rw-r--r--editors/code/src/run.ts19
1 files changed, 12 insertions, 7 deletions
diff --git a/editors/code/src/run.ts b/editors/code/src/run.ts
index 17573cd82..f42baed16 100644
--- a/editors/code/src/run.ts
+++ b/editors/code/src/run.ts
@@ -128,13 +128,7 @@ export async function createTask(runnable: ra.Runnable, config: Config): Promise
128 throw `Unexpected runnable kind: ${runnable.kind}`; 128 throw `Unexpected runnable kind: ${runnable.kind}`;
129 } 129 }
130 130
131 const args = [...runnable.args.cargoArgs]; // should be a copy! 131 const args = createArgs(runnable);
132 if (runnable.args.cargoExtraArgs) {
133 args.push(...runnable.args.cargoExtraArgs); // Append user-specified cargo options.
134 }
135 if (runnable.args.executableArgs.length > 0) {
136 args.push('--', ...runnable.args.executableArgs);
137 }
138 132
139 const definition: tasks.CargoTaskDefinition = { 133 const definition: tasks.CargoTaskDefinition = {
140 type: tasks.TASK_TYPE, 134 type: tasks.TASK_TYPE,
@@ -151,3 +145,14 @@ export async function createTask(runnable: ra.Runnable, config: Config): Promise
151 145
152 return cargoTask; 146 return cargoTask;
153} 147}
148
149export function createArgs(runnable: ra.Runnable): string[] {
150 const args = [...runnable.args.cargoArgs]; // should be a copy!
151 if (runnable.args.cargoExtraArgs) {
152 args.push(...runnable.args.cargoExtraArgs); // Append user-specified cargo options.
153 }
154 if (runnable.args.executableArgs.length > 0) {
155 args.push('--', ...runnable.args.executableArgs);
156 }
157 return args;
158}