From d6b908ec41df85bb3d557f7be6637968611c58a0 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 12 Nov 2023 17:48:40 +0100 Subject: [PATCH] Fix import preference config keys --- crates/rust-analyzer/src/config.rs | 16 ++++++++-------- docs/user/generated_config.adoc | 4 ++-- editors/code/package.json | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 6b8de861db9..f28f6ffb874 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -352,9 +352,9 @@ config_data! { /// Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`. imports_merge_glob: bool = "true", /// Prefer to unconditionally use imports of the core and alloc crate, over the std crate. - imports_prefer_no_std: bool = "false", + imports_preferNoStd | imports_prefer_no_std: bool = "false", /// Whether to prefer import paths containing a `prelude` module. - imports_prefer_prelude: bool = "false", + imports_preferPrelude: bool = "false", /// The path structure for newly inserted paths to use. imports_prefix: ImportPrefixDef = "\"plain\"", @@ -1119,8 +1119,8 @@ impl Config { ExprFillDefaultDef::Default => ExprFillDefaultMode::Default, }, insert_use: self.insert_use_config(), - prefer_no_std: self.data.imports_prefer_no_std, - prefer_prelude: self.data.imports_prefer_prelude, + prefer_no_std: self.data.imports_preferNoStd, + prefer_prelude: self.data.imports_preferPrelude, } } @@ -1489,8 +1489,8 @@ impl Config { CallableCompletionDef::None => None, }, insert_use: self.insert_use_config(), - prefer_no_std: self.data.imports_prefer_no_std, - prefer_prelude: self.data.imports_prefer_prelude, + prefer_no_std: self.data.imports_preferNoStd, + prefer_prelude: self.data.imports_preferPrelude, snippet_cap: SnippetCap::new(try_or_def!( self.caps .text_document @@ -1519,8 +1519,8 @@ impl Config { snippet_cap: SnippetCap::new(self.experimental("snippetTextEdit")), allowed: None, insert_use: self.insert_use_config(), - prefer_no_std: self.data.imports_prefer_no_std, - prefer_prelude: self.data.imports_prefer_prelude, + prefer_no_std: self.data.imports_preferNoStd, + prefer_prelude: self.data.imports_preferPrelude, assist_emit_must_use: self.data.assist_emitMustUse, } } diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc index 7460df49fc0..7091ea1ce9a 100644 --- a/docs/user/generated_config.adoc +++ b/docs/user/generated_config.adoc @@ -493,12 +493,12 @@ Group inserted imports by the https://rust-analyzer.github.io/manual.html#auto-i -- Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`. -- -[[rust-analyzer.imports.prefer.no.std]]rust-analyzer.imports.prefer.no.std (default: `false`):: +[[rust-analyzer.imports.preferNoStd]]rust-analyzer.imports.preferNoStd (default: `false`):: + -- Prefer to unconditionally use imports of the core and alloc crate, over the std crate. -- -[[rust-analyzer.imports.prefer.prelude]]rust-analyzer.imports.prefer.prelude (default: `false`):: +[[rust-analyzer.imports.preferPrelude]]rust-analyzer.imports.preferPrelude (default: `false`):: + -- Whether to prefer import paths containing a `prelude` module. diff --git a/editors/code/package.json b/editors/code/package.json index 1497b61e67b..a4ce7314dd4 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -1129,12 +1129,12 @@ "default": true, "type": "boolean" }, - "rust-analyzer.imports.prefer.no.std": { + "rust-analyzer.imports.preferNoStd": { "markdownDescription": "Prefer to unconditionally use imports of the core and alloc crate, over the std crate.", "default": false, "type": "boolean" }, - "rust-analyzer.imports.prefer.prelude": { + "rust-analyzer.imports.preferPrelude": { "markdownDescription": "Whether to prefer import paths containing a `prelude` module.", "default": false, "type": "boolean"