diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-20 14:32:45 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-20 14:32:45 +0100 |
commit | 7aab09ca6c62ee19528b0acf5b164d66f78575db (patch) | |
tree | 6a01d18b70fca8783b5dfcc59d5fdf01fb5dbd40 /crates/ide_assists/src | |
parent | 8bb37737c9e8b7a390ae29d5fb0daaeeb495d2b5 (diff) | |
parent | 066856ab5b50fb458c0650959d45e99bac6dffca (diff) |
Merge #8893
8893: Update outdated auto-import documentation r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Tobias Wirth <[email protected]>
Diffstat (limited to 'crates/ide_assists/src')
-rw-r--r-- | crates/ide_assists/src/handlers/auto_import.rs | 17 |
1 files changed, 8 insertions, 9 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 | // |