aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/rust-analyzer/src/config.rs4
-rw-r--r--crates/rust-analyzer/src/main_loop.rs1
-rw-r--r--crates/rust-analyzer/src/world.rs1
-rw-r--r--editors/code/package.json5
-rw-r--r--editors/code/src/client.ts1
-rw-r--r--editors/code/src/config.ts1
6 files changed, 13 insertions, 0 deletions
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs
index 3314269ec..a8bf29ddf 100644
--- a/crates/rust-analyzer/src/config.rs
+++ b/crates/rust-analyzer/src/config.rs
@@ -44,6 +44,9 @@ pub struct ServerConfig {
44 /// Fine grained feature flags to disable specific features. 44 /// Fine grained feature flags to disable specific features.
45 pub feature_flags: FxHashMap<String, bool>, 45 pub feature_flags: FxHashMap<String, bool>,
46 46
47 /// Fine grained controls for additional `OUT_DIR` env variables
48 pub additional_out_dirs: FxHashMap<String, String>,
49
47 pub rustfmt_args: Vec<String>, 50 pub rustfmt_args: Vec<String>,
48 51
49 /// Cargo feature configurations. 52 /// Cargo feature configurations.
@@ -64,6 +67,7 @@ impl Default for ServerConfig {
64 cargo_watch_all_targets: true, 67 cargo_watch_all_targets: true,
65 with_sysroot: true, 68 with_sysroot: true,
66 feature_flags: FxHashMap::default(), 69 feature_flags: FxHashMap::default(),
70 additional_out_dirs: FxHashMap::default(),
67 cargo_features: Default::default(), 71 cargo_features: Default::default(),
68 rustfmt_args: Vec::new(), 72 rustfmt_args: Vec::new(),
69 } 73 }
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs
index 221f464b6..6d123f629 100644
--- a/crates/rust-analyzer/src/main_loop.rs
+++ b/crates/rust-analyzer/src/main_loop.rs
@@ -195,6 +195,7 @@ pub fn main_loop(
195 Watch(!config.use_client_watching), 195 Watch(!config.use_client_watching),
196 options, 196 options,
197 feature_flags, 197 feature_flags,
198 config.additional_out_dirs,
198 ) 199 )
199 }; 200 };
200 201
diff --git a/crates/rust-analyzer/src/world.rs b/crates/rust-analyzer/src/world.rs
index 6f394055a..ac4395617 100644
--- a/crates/rust-analyzer/src/world.rs
+++ b/crates/rust-analyzer/src/world.rs
@@ -76,6 +76,7 @@ impl WorldState {
76 watch: Watch, 76 watch: Watch,
77 options: Options, 77 options: Options,
78 feature_flags: FeatureFlags, 78 feature_flags: FeatureFlags,
79 additional_out_dirs: FxHashMap<String, String>,
79 ) -> WorldState { 80 ) -> WorldState {
80 let mut change = AnalysisChange::new(); 81 let mut change = AnalysisChange::new();
81 82
diff --git a/editors/code/package.json b/editors/code/package.json
index 7a4a93e30..b856729d3 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -224,6 +224,11 @@
224 "default": true, 224 "default": true,
225 "description": "Whether to ask for permission before downloading any files from the Internet" 225 "description": "Whether to ask for permission before downloading any files from the Internet"
226 }, 226 },
227 "rust-analyzer.additionalOutDirs": {
228 "type": "object",
229 "default": {},
230 "markdownDescription": "Fine grained controls for OUT_DIR `env!(\"OUT_DIR\")` variable. e.g. `{\"foo\":\"/path/to/foo\"}`, "
231 },
227 "rust-analyzer.serverPath": { 232 "rust-analyzer.serverPath": {
228 "type": [ 233 "type": [
229 "null", 234 "null",
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index 540f7c9ea..6ce3b9235 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -37,6 +37,7 @@ export async function createClient(config: Config, serverPath: string): Promise<
37 excludeGlobs: config.excludeGlobs, 37 excludeGlobs: config.excludeGlobs,
38 useClientWatching: config.useClientWatching, 38 useClientWatching: config.useClientWatching,
39 featureFlags: config.featureFlags, 39 featureFlags: config.featureFlags,
40 additionalOutDirs: config.additionalOutDirs,
40 withSysroot: config.withSysroot, 41 withSysroot: config.withSysroot,
41 cargoFeatures: config.cargoFeatures, 42 cargoFeatures: config.cargoFeatures,
42 rustfmtArgs: config.rustfmtArgs, 43 rustfmtArgs: config.rustfmtArgs,
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index b72206d3c..3ade7e900 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -154,6 +154,7 @@ export class Config {
154 get excludeGlobs() { return this.cfg.get("excludeGlobs") as string[]; } 154 get excludeGlobs() { return this.cfg.get("excludeGlobs") as string[]; }
155 get useClientWatching() { return this.cfg.get("useClientWatching") as boolean; } 155 get useClientWatching() { return this.cfg.get("useClientWatching") as boolean; }
156 get featureFlags() { return this.cfg.get("featureFlags") as Record<string, boolean>; } 156 get featureFlags() { return this.cfg.get("featureFlags") as Record<string, boolean>; }
157 get additionalOutDirs() { return this.cfg.get("additionalOutDirs") as Record<string, string>; }
157 get rustfmtArgs() { return this.cfg.get("rustfmtArgs") as string[]; } 158 get rustfmtArgs() { return this.cfg.get("rustfmtArgs") as string[]; }
158 159
159 get cargoWatchOptions(): CargoWatchOptions { 160 get cargoWatchOptions(): CargoWatchOptions {