From 066856ab5b50fb458c0650959d45e99bac6dffca Mon Sep 17 00:00:00 2001 From: Lukas Tobias Wirth Date: Thu, 20 May 2021 15:29:21 +0200 Subject: [PATCH] Update outdated auto-import documentation --- crates/ide_assists/src/handlers/auto_import.rs | 17 ++++++++--------- docs/user/manual.adoc | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/crates/ide_assists/src/handlers/auto_import.rs b/crates/ide_assists/src/handlers/auto_import.rs index dda5a6631c8..d4748ef3a0e 100644 --- a/crates/ide_assists/src/handlers/auto_import.rs +++ b/crates/ide_assists/src/handlers/auto_import.rs @@ -33,20 +33,19 @@ // use super::AssistContext; // ``` // -// .Merge Behavior +// .Import Granularity // -// 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 `importGranularity` setting. // It has the following configurations: // -// - `full`: This setting will cause auto-import to always completely merge use-trees that share the -// same path prefix while also merging inner trees that share the same path-prefix. This kind of +// - `crate`: Merge imports from the same crate into a single use statement. This kind of // nesting is only supported in Rust versions later than 1.24. -// - `last`: This setting will cause auto-import to merge use-trees as long as the resulting tree -// will only contain a nesting of single segment paths at the very end. -// - `none`: This setting will cause auto-import to never merge use-trees keeping them as simple -// paths. +// - `module`: Merge imports from the same module into a single use statement. +// - `item`: Don't merge imports at all, creating one import per item. +// - `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.importMergeBehavior`. +// In `VS Code` the configuration for this is `rust-analyzer.assist.importGranularity`. // // .Import Prefix // diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc index f96c09a79fe..1d8a1930a9b 100644 --- a/docs/user/manual.adoc +++ b/docs/user/manual.adoc @@ -276,7 +276,7 @@ nvim_lsp.rust_analyzer.setup({ settings = { ["rust-analyzer"] = { assist = { - importMergeBehavior = "last", + importGranularity = "module", importPrefix = "by_self", }, cargo = { -- 2.44.0