Add runnable env support.

This commit is contained in:
vsrs 2020-07-02 19:47:40 +03:00
parent 57576ac420
commit 7b79d24ad5
4 changed files with 69 additions and 11 deletions

View file

@ -5,6 +5,8 @@ export type UpdatesChannel = "stable" | "nightly";
export const NIGHTLY_TAG = "nightly";
export type RunnableEnvCfg = Record<string, string> | [{ mask?: string, env: Record<string, string>; }]
export class Config {
readonly extensionId = "matklad.rust-analyzer";
@ -114,6 +116,10 @@ export class Config {
return this.get<string | undefined>("cargoRunner");
}
get runnableEnv() {
return this.get<RunnableEnvCfg | undefined>("runnableEnv");
}
get debug() {
// "/rustc/<id>" used by suggestions only.
const { ["/rustc/<id>"]: _, ...sourceFileMap } = this.get<Record<string, string>>("debug.sourceFileMap");