]> git.lizzy.rs Git - rust.git/commitdiff
Merge #8873
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Thu, 20 May 2021 08:27:16 +0000 (08:27 +0000)
committerGitHub <noreply@github.com>
Thu, 20 May 2021 08:27:16 +0000 (08:27 +0000)
8873: Implement import-granularity guessing  r=matklad a=Veykril

This renames our `MergeBehavior` to `ImportGranularity` as rustfmt has it as the purpose of them are basically the same. `ImportGranularity::Preserve` currently has no specific purpose for us as we don't have an organize imports assist yet, so it currently acts the same as `ImportGranularity::Item`.

We now try to guess the import style on a per file basis and fall back to the user granularity setting if the file has no specific style yet or where it is ambiguous. This can be turned off by setting `import.enforceGranularity` to `true`.

Closes https://github.com/rust-analyzer/rust-analyzer/issues/8870

Co-authored-by: Lukas Tobias Wirth <lukastw97@gmail.com>

No differences found