From 33c6c7abc6621f8b0cf083a98f7e4788cf4b5b54 Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Mon, 16 Mar 2020 13:43:29 +0100 Subject: Support loading OUT_DIR from cargo check at launch --- editors/code/package.json | 5 +++++ editors/code/src/config.ts | 3 +++ 2 files changed, 8 insertions(+) (limited to 'editors') diff --git a/editors/code/package.json b/editors/code/package.json index 48f28b28a..188a2f9ca 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -362,6 +362,11 @@ }, "default": [], "description": "List of features to activate" + }, + "rust-analyzer.cargoFeatures.loadOutDirsFromCheck": { + "type": "boolean", + "default": false, + "markdownDescription": "Run `cargo check` on startup to get the correct value for package OUT_DIRs" } } }, diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index bd8096dd6..84ec81ecd 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -22,6 +22,7 @@ export interface CargoFeatures { noDefaultFeatures: boolean; allFeatures: boolean; features: string[]; + loadOutDirsFromCheck: boolean; } export const enum UpdatesChannel { @@ -204,6 +205,7 @@ export class Config { get featureFlags() { return this.cfg.get("featureFlags") as Record; } get additionalOutDirs() { return this.cfg.get("additionalOutDirs") as Record; } get rustfmtArgs() { return this.cfg.get("rustfmtArgs") as string[]; } + get loadOutDirsFromCheck() { return this.cfg.get("loadOutDirsFromCheck") as boolean; } get cargoWatchOptions(): CargoWatchOptions { return { @@ -219,6 +221,7 @@ export class Config { noDefaultFeatures: this.cfg.get("cargoFeatures.noDefaultFeatures") as boolean, allFeatures: this.cfg.get("cargoFeatures.allFeatures") as boolean, features: this.cfg.get("cargoFeatures.features") as string[], + loadOutDirsFromCheck: this.cfg.get("cargoFeatures.loadOutDirsFromCheck") as boolean, }; } -- cgit v1.2.3