aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/code/src/lsp_ext.ts1
-rw-r--r--editors/code/src/run.ts6
2 files changed, 6 insertions, 1 deletions
diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts
index e16ea799c..fdb99956b 100644
--- a/editors/code/src/lsp_ext.ts
+++ b/editors/code/src/lsp_ext.ts
@@ -60,6 +60,7 @@ export interface Runnable {
60 workspaceRoot?: string; 60 workspaceRoot?: string;
61 cargoArgs: string[]; 61 cargoArgs: string[];
62 executableArgs: string[]; 62 executableArgs: string[];
63 expectTest?: boolean;
63 }; 64 };
64} 65}
65export const runnables = new lc.RequestType<RunnablesParams, Runnable[], void>("experimental/runnables"); 66export const runnables = new lc.RequestType<RunnablesParams, Runnable[], void>("experimental/runnables");
diff --git a/editors/code/src/run.ts b/editors/code/src/run.ts
index 766b05112..e1430e31f 100644
--- a/editors/code/src/run.ts
+++ b/editors/code/src/run.ts
@@ -108,12 +108,16 @@ export async function createTask(runnable: ra.Runnable, config: Config): Promise
108 if (runnable.args.executableArgs.length > 0) { 108 if (runnable.args.executableArgs.length > 0) {
109 args.push('--', ...runnable.args.executableArgs); 109 args.push('--', ...runnable.args.executableArgs);
110 } 110 }
111 const env: { [key: string]: string } = { "RUST_BACKTRACE": "short" };
112 if (runnable.args.expectTest) {
113 env["UPDATE_EXPECT"] = "1";
114 }
111 const definition: tasks.CargoTaskDefinition = { 115 const definition: tasks.CargoTaskDefinition = {
112 type: tasks.TASK_TYPE, 116 type: tasks.TASK_TYPE,
113 command: args[0], // run, test, etc... 117 command: args[0], // run, test, etc...
114 args: args.slice(1), 118 args: args.slice(1),
115 cwd: runnable.args.workspaceRoot, 119 cwd: runnable.args.workspaceRoot,
116 env: Object.assign({}, process.env as { [key: string]: string }, { "RUST_BACKTRACE": "short" }), 120 env: Object.assign({}, process.env as { [key: string]: string }, env),
117 }; 121 };
118 122
119 const target = vscode.workspace.workspaceFolders![0]; // safe, see main activate() 123 const target = vscode.workspace.workspaceFolders![0]; // safe, see main activate()