diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-10 21:10:59 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-10 21:10:59 +0100 |
commit | 77f0c92fd8311bccc001ddaf9eb72662d35e9836 (patch) | |
tree | bdc532c6318c3378de63649ae65a4f420aa7db2a /editors/code | |
parent | c7edc38cd0c55ea85356112608bbb928856f6865 (diff) | |
parent | 59c2efe4b6de41424a5bfd2a0cb59a43ffc11042 (diff) |
Merge #8794
8794: Give MergeBehaviour variants better names r=Veykril a=Veykril
I never really liked the variant names I gave this enum from the beginning and then I found out about rustfmt's `imports_granularity` config:
> imports_granularity
>
> How imports should be grouped into use statements. Imports will be merged or split to the configured level of granularity.
>
> Default value: Preserve
> Possible values: Preserve, Crate, Module, Item
> Stable: No
I personally prefer using `crate` over `full` and `module` over last, they seem more descriptive. Keeping these similar between tooling also seems like a good plus point to me.
We might even wanna take over the entire enum at some point if we have a `format/cleanup imports` assists in the future which would probably want to also have the `preserve` and `item` options.
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'editors/code')
-rw-r--r-- | editors/code/package.json | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index 0cc265aa4..f35d30898 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -382,17 +382,17 @@ | |||
382 | "$generated-start": false, | 382 | "$generated-start": false, |
383 | "rust-analyzer.assist.importMergeBehavior": { | 383 | "rust-analyzer.assist.importMergeBehavior": { |
384 | "markdownDescription": "The strategy to use when inserting new imports or merging imports.", | 384 | "markdownDescription": "The strategy to use when inserting new imports or merging imports.", |
385 | "default": "full", | 385 | "default": "crate", |
386 | "type": "string", | 386 | "type": "string", |
387 | "enum": [ | 387 | "enum": [ |
388 | "none", | 388 | "none", |
389 | "full", | 389 | "crate", |
390 | "last" | 390 | "module" |
391 | ], | 391 | ], |
392 | "enumDescriptions": [ | 392 | "enumDescriptions": [ |
393 | "No merging", | 393 | "Do not merge imports at all.", |
394 | "Merge all layers of the import trees", | 394 | "Merge imports from the same crate into a single `use` statement.", |
395 | "Only merge the last layer of the import trees" | 395 | "Merge imports from the same module into a single `use` statement." |
396 | ] | 396 | ] |
397 | }, | 397 | }, |
398 | "rust-analyzer.assist.importPrefix": { | 398 | "rust-analyzer.assist.importPrefix": { |