aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ide_assists/src/handlers/auto_import.rs17
-rw-r--r--docs/user/manual.adoc2
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 dda5a6631..d4748ef3a 100644
--- a/crates/ide_assists/src/handlers/auto_import.rs
+++ b/crates/ide_assists/src/handlers/auto_import.rs
@@ -33,20 +33,19 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
33// use super::AssistContext; 33// use super::AssistContext;
34// ``` 34// ```
35// 35//
36// .Merge Behavior 36// .Import Granularity
37// 37//
38// It is possible to configure how use-trees are merged with the `importMergeBehavior` setting. 38// It is possible to configure how use-trees are merged with the `importGranularity` setting.
39// It has the following configurations: 39// It has the following configurations:
40// 40//
41// - `full`: This setting will cause auto-import to always completely merge use-trees that share the 41// - `crate`: Merge imports from the same crate into a single use statement. This kind of
42// same path prefix while also merging inner trees that share the same path-prefix. This kind of
43// nesting is only supported in Rust versions later than 1.24. 42// nesting is only supported in Rust versions later than 1.24.
44// - `last`: This setting will cause auto-import to merge use-trees as long as the resulting tree 43// - `module`: Merge imports from the same module into a single use statement.
45// will only contain a nesting of single segment paths at the very end. 44// - `item`: Don't merge imports at all, creating one import per item.
46// - `none`: This setting will cause auto-import to never merge use-trees keeping them as simple 45// - `preserve`: Do not change the granularity of any imports. For auto-import this has the same
47// paths. 46// effect as `item`.
48// 47//
49// In `VS Code` the configuration for this is `rust-analyzer.assist.importMergeBehavior`. 48// In `VS Code` the configuration for this is `rust-analyzer.assist.importGranularity`.
50// 49//
51// .Import Prefix 50// .Import Prefix
52// 51//
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc
index f96c09a79..1d8a1930a 100644
--- a/docs/user/manual.adoc
+++ b/docs/user/manual.adoc
@@ -276,7 +276,7 @@ nvim_lsp.rust_analyzer.setup({
276 settings = { 276 settings = {
277 ["rust-analyzer"] = { 277 ["rust-analyzer"] = {
278 assist = { 278 assist = {
279 importMergeBehavior = "last", 279 importGranularity = "module",
280 importPrefix = "by_self", 280 importPrefix = "by_self",
281 }, 281 },
282 cargo = { 282 cargo = {