mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 03:25:55 +00:00
Update outdated auto-import documentation
This commit is contained in:
parent
8bb37737c9
commit
066856ab5b
@ -33,20 +33,19 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
|
|||||||
// use super::AssistContext;
|
// 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:
|
// It has the following configurations:
|
||||||
//
|
//
|
||||||
// - `full`: This setting will cause auto-import to always completely merge use-trees that share the
|
// - `crate`: Merge imports from the same crate into a single use statement. This kind of
|
||||||
// same path prefix while also merging inner trees that share the same path-prefix. This kind of
|
|
||||||
// nesting is only supported in Rust versions later than 1.24.
|
// 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
|
// - `module`: Merge imports from the same module into a single use statement.
|
||||||
// will only contain a nesting of single segment paths at the very end.
|
// - `item`: Don't merge imports at all, creating one import per item.
|
||||||
// - `none`: This setting will cause auto-import to never merge use-trees keeping them as simple
|
// - `preserve`: Do not change the granularity of any imports. For auto-import this has the same
|
||||||
// paths.
|
// 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
|
// .Import Prefix
|
||||||
//
|
//
|
||||||
|
@ -276,7 +276,7 @@ nvim_lsp.rust_analyzer.setup({
|
|||||||
settings = {
|
settings = {
|
||||||
["rust-analyzer"] = {
|
["rust-analyzer"] = {
|
||||||
assist = {
|
assist = {
|
||||||
importMergeBehavior = "last",
|
importGranularity = "module",
|
||||||
importPrefix = "by_self",
|
importPrefix = "by_self",
|
||||||
},
|
},
|
||||||
cargo = {
|
cargo = {
|
||||||
|
Loading…
Reference in New Issue
Block a user