Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--crates/ide-assists/src/handlers/auto_import.rs8
-rw-r--r--crates/ide-completion/src/completions/flyimport.rs2
-rw-r--r--crates/ide-completion/src/snippet.rs4
-rw-r--r--crates/project-model/src/workspace.rs4
-rw-r--r--crates/rust-analyzer/src/handlers.rs2
-rw-r--r--docs/user/manual.adoc22
6 files changed, 25 insertions, 17 deletions
diff --git a/crates/ide-assists/src/handlers/auto_import.rs b/crates/ide-assists/src/handlers/auto_import.rs
index 1ec24d8fcc..802449f858 100644
--- a/crates/ide-assists/src/handlers/auto_import.rs
+++ b/crates/ide-assists/src/handlers/auto_import.rs
@@ -40,7 +40,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
//
// .Import Granularity
//
-// It is possible to configure how use-trees are merged with the `importGranularity` setting.
+// It is possible to configure how use-trees are merged with the `imports.granularity.group` setting.
// It has the following configurations:
//
// - `crate`: Merge imports from the same crate into a single use statement. This kind of
@@ -50,11 +50,11 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
// - `preserve`: Do not change the granularity of any imports. For auto-import this has the same
// effect as `item`.
//
-// In `VS Code` the configuration for this is `rust-analyzer.assist.importGranularity`.
+// In `VS Code` the configuration for this is `rust-analyzer.imports.granularity.group`.
//
// .Import Prefix
//
-// The style of imports in the same crate is configurable through the `importPrefix` setting.
+// The style of imports in the same crate is configurable through the `imports.prefix` setting.
// It has the following configurations:
//
// - `crate`: This setting will force paths to be always absolute, starting with the `crate`
@@ -64,7 +64,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
// `super` or an extern crate identifier.
// - `plain`: This setting does not impose any restrictions in imports.
//
-// In `VS Code` the configuration for this is `rust-analyzer.assist.importPrefix`.
+// In `VS Code` the configuration for this is `rust-analyzer.imports.prefix`.
//
// image::https://user-images.githubusercontent.com/48062697/113020673-b85be580-917a-11eb-9022-59585f35d4f8.gif[]
diff --git a/crates/ide-completion/src/completions/flyimport.rs b/crates/ide-completion/src/completions/flyimport.rs
index 1c62347fb5..6dbcfb0a5d 100644
--- a/crates/ide-completion/src/completions/flyimport.rs
+++ b/crates/ide-completion/src/completions/flyimport.rs
@@ -95,7 +95,7 @@ use super::Completions;
//
// .Import configuration
//
-// It is possible to configure how use-trees are merged with the `importMergeBehavior` setting.
+// It is possible to configure how use-trees are merged with the `imports.granularity.group` setting.
// Mimics the corresponding behavior of the `Auto Import` feature.
//
// .LSP and performance implications
diff --git a/crates/ide-completion/src/snippet.rs b/crates/ide-completion/src/snippet.rs
index a6bb3d0648..d2680c7758 100644
--- a/crates/ide-completion/src/snippet.rs
+++ b/crates/ide-completion/src/snippet.rs
@@ -6,12 +6,12 @@
//
// rust-analyzer allows the user to define custom (postfix)-snippets that may depend on items to be accessible for the current scope to be applicable.
//
-// A custom snippet can be defined by adding it to the `rust-analyzer.completion.snippets` object respectively.
+// A custom snippet can be defined by adding it to the `rust-analyzer.completion.snippets.custom` object respectively.
//
// [source,json]
// ----
// {
-// "rust-analyzer.completion.snippets": {
+// "rust-analyzer.completion.snippets.custom": {
// "thread spawn": {
// "prefix": ["spawn", "tspawn"],
// "body": [
diff --git a/crates/project-model/src/workspace.rs b/crates/project-model/src/workspace.rs
index ad2f7e51bb..de42458354 100644
--- a/crates/project-model/src/workspace.rs
+++ b/crates/project-model/src/workspace.rs
@@ -737,7 +737,7 @@ fn handle_rustc_crates(
let root_pkg =
rustc_workspace.packages().find(|package| rustc_workspace[*package].name == "rustc_driver");
// The rustc workspace might be incomplete (such as if rustc-dev is not
- // installed for the current toolchain) and `rustcSource` is set to discover.
+ // installed for the current toolchain) and `rustc_source` is set to discover.
if let Some(root_pkg) = root_pkg {
// Iterate through every crate in the dependency subtree of rustc_driver using BFS
let mut queue = VecDeque::new();
@@ -822,7 +822,7 @@ fn handle_rustc_crates(
for (from, _) in pkg_crates.get(&pkg).into_iter().flatten() {
// Avoid creating duplicate dependencies
// This avoids the situation where `from` depends on e.g. `arrayvec`, but
- // `rust_analyzer` thinks that it should use the one from the `rustcSource`
+ // `rust_analyzer` thinks that it should use the one from the `rustc_source`
// instead of the one from `crates.io`
if !crate_graph[*from].dependencies.iter().any(|d| d.name == name) {
add_dep(crate_graph, *from, name.clone(), to);
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs
index 69a03850b5..e3875228a1 100644
--- a/crates/rust-analyzer/src/handlers.rs
+++ b/crates/rust-analyzer/src/handlers.rs
@@ -1798,7 +1798,7 @@ fn run_rustfmt(
String::from(
"rustfmt range formatting is unstable. \
Opt-in by using a nightly build of rustfmt and setting \
- `rustfmt.enableRangeFormatting` to true in your LSP configuration",
+ `rustfmt.rangeFormatting.enable` to true in your LSP configuration",
),
)
.into());
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc
index f55dfd4703..999a6437ab 100644
--- a/docs/user/manual.adoc
+++ b/docs/user/manual.adoc
@@ -308,12 +308,16 @@ nvim_lsp.rust_analyzer.setup({
on_attach=on_attach,
settings = {
["rust-analyzer"] = {
- assist = {
- importGranularity = "module",
- importPrefix = "self",
+ imports = {
+ granularity = {
+ group = "module",
+ },
+ prefix = "self",
},
cargo = {
- loadOutDirsFromCheck = true
+ buildScripts = {
+ enable = true,
+ },
},
procMacro = {
enable = true
@@ -364,7 +368,9 @@ if executable('rust-analyzer')
\ 'whitelist': ['rust'],
\ 'initialization_options': {
\ 'cargo': {
- \ 'loadOutDirsFromCheck': v:true,
+ \ 'buildScripts': {
+ \ 'enable': v:true,
+ \ },
\ },
\ 'procMacro': {
\ 'enable': v:true,
@@ -527,7 +533,9 @@ For example, a very common configuration is to enable proc-macro support, can be
----
{
"cargo": {
- "loadOutDirsFromCheck": true,
+ "buildScripts": {
+ "enable": true,
+ },
},
"procMacro": {
"enable": true,
@@ -705,7 +713,7 @@ include::./generated_assists.adoc[]
== Diagnostics
While most errors and warnings provided by rust-analyzer come from the `cargo check` integration, there's a growing number of diagnostics implemented using rust-analyzer's own analysis.
-Some of these diagnostics don't respect `\#[allow]` or `\#[deny]` attributes yet, but can be turned off using the `rust-analyzer.diagnostics.enable`, `rust-analyzer.diagnostics.enableExperimental` or `rust-analyzer.diagnostics.disabled` settings.
+Some of these diagnostics don't respect `\#[allow]` or `\#[deny]` attributes yet, but can be turned off using the `rust-analyzer.diagnostics.enable`, `rust-analyzer.diagnostics.experimental.enable` or `rust-analyzer.diagnostics.disabled` settings.
include::./generated_diagnostic.adoc[]