]> git.lizzy.rs Git - rust.git/commitdiff
Update outdated auto-import documentation
authorLukas Tobias Wirth <lukastw97@gmail.com>
Thu, 20 May 2021 13:29:21 +0000 (15:29 +0200)
committerLukas Tobias Wirth <lukastw97@gmail.com>
Thu, 20 May 2021 13:31:33 +0000 (15:31 +0200)
crates/ide_assists/src/handlers/auto_import.rs
docs/user/manual.adoc

index dda5a6631c8c1726f59cf69c95d92b338ea53f95..d4748ef3a0e8787af8e0219ed3f9c00a7c4af626 100644 (file)
 // 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
 //
index f96c09a79fe82ef72ee48e3f2fb83383e1f71719..1d8a1930a9b78c2d4c3bb0faed9633e74fe34ecd 100644 (file)
@@ -276,7 +276,7 @@ nvim_lsp.rust_analyzer.setup({
     settings = {
         ["rust-analyzer"] = {
             assist = {
-                importMergeBehavior = "last",
+                importGranularity = "module",
                 importPrefix = "by_self",
             },
             cargo = {