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 From f5a2fcf8f59eda3498bbdcb87568e5ba6b4db8b7 Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Mon, 16 Mar 2020 14:10:13 +0100 Subject: Change existing OUT_DIR override config to make use of new infrastructure --- editors/code/package.json | 10 +++++----- editors/code/src/config.ts | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'editors') diff --git a/editors/code/package.json b/editors/code/package.json index 188a2f9ca..b4128acf0 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -237,11 +237,6 @@ "default": true, "description": "Whether to ask for permission before downloading any files from the Internet" }, - "rust-analyzer.additionalOutDirs": { - "type": "object", - "default": {}, - "markdownDescription": "Fine grained controls for OUT_DIR `env!(\"OUT_DIR\")` variable. e.g. `{\"foo\":\"/path/to/foo\"}`, " - }, "rust-analyzer.serverPath": { "type": [ "null", @@ -367,6 +362,11 @@ "type": "boolean", "default": false, "markdownDescription": "Run `cargo check` on startup to get the correct value for package OUT_DIRs" + }, + "rust-analyzer.cargoFeatures.outDirOverrides": { + "type": "object", + "default": {}, + "markdownDescription": "Fine grained controls for OUT_DIR `env!(\"OUT_DIR\")` variable. e.g. `{\"foo 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)\":\"/path/to/foo\"}`, " } } }, diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 84ec81ecd..c7323f6e9 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -23,6 +23,7 @@ export interface CargoFeatures { allFeatures: boolean; features: string[]; loadOutDirsFromCheck: boolean; + outDirOverrides: Record; } export const enum UpdatesChannel { @@ -203,7 +204,6 @@ export class Config { get excludeGlobs() { return this.cfg.get("excludeGlobs") as string[]; } get useClientWatching() { return this.cfg.get("useClientWatching") as boolean; } 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; } @@ -222,6 +222,7 @@ export class Config { allFeatures: this.cfg.get("cargoFeatures.allFeatures") as boolean, features: this.cfg.get("cargoFeatures.features") as string[], loadOutDirsFromCheck: this.cfg.get("cargoFeatures.loadOutDirsFromCheck") as boolean, + outDirOverrides: this.cfg.get("cargoFeatures.outDirOverrides") as Record, }; } -- cgit v1.2.3 From 9e7dbb1abd8ca502749d734ef25ba3359dc7d11b Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Mon, 16 Mar 2020 14:22:25 +0100 Subject: Remove unused config from VSCode ext --- editors/code/src/client.ts | 1 - 1 file changed, 1 deletion(-) (limited to 'editors') diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index d65454275..08d821dd0 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts @@ -42,7 +42,6 @@ export async function createClient(config: Config, serverPath: string): Promise< excludeGlobs: config.excludeGlobs, useClientWatching: config.useClientWatching, featureFlags: config.featureFlags, - additionalOutDirs: config.additionalOutDirs, withSysroot: config.withSysroot, cargoFeatures: config.cargoFeatures, rustfmtArgs: config.rustfmtArgs, -- cgit v1.2.3 From e154132c911be41b75e84d01de5c7efa4da9168e Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Tue, 17 Mar 2020 14:55:44 +0100 Subject: Remove outDirOverrides --- editors/code/package.json | 5 ----- editors/code/src/config.ts | 2 -- 2 files changed, 7 deletions(-) (limited to 'editors') diff --git a/editors/code/package.json b/editors/code/package.json index b4128acf0..b9e0ffd2b 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -362,11 +362,6 @@ "type": "boolean", "default": false, "markdownDescription": "Run `cargo check` on startup to get the correct value for package OUT_DIRs" - }, - "rust-analyzer.cargoFeatures.outDirOverrides": { - "type": "object", - "default": {}, - "markdownDescription": "Fine grained controls for OUT_DIR `env!(\"OUT_DIR\")` variable. e.g. `{\"foo 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)\":\"/path/to/foo\"}`, " } } }, diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index c7323f6e9..b45b14bef 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -23,7 +23,6 @@ export interface CargoFeatures { allFeatures: boolean; features: string[]; loadOutDirsFromCheck: boolean; - outDirOverrides: Record; } export const enum UpdatesChannel { @@ -222,7 +221,6 @@ export class Config { allFeatures: this.cfg.get("cargoFeatures.allFeatures") as boolean, features: this.cfg.get("cargoFeatures.features") as string[], loadOutDirsFromCheck: this.cfg.get("cargoFeatures.loadOutDirsFromCheck") as boolean, - outDirOverrides: this.cfg.get("cargoFeatures.outDirOverrides") as Record, }; } -- cgit v1.2.3