plugins.rust-tools.server.imports.granularity.enforce

Whether to enforce the import granularity setting for all files. If set to false rust-analyzer will try to keep import styles consistent per file.

default:

false

Type: null or boolean

Default: null

Declared by:

plugins.rust-tools.server.imports.granularity.group

How imports should be grouped into use statements.

Values:

  • preserve: Do not change the granularity of any imports and preserve the original structure written by the developer.
  • crate: Merge imports from the same crate into a single use statement. Conversely, imports from different crates are split into separate statements.
  • module: Merge imports from the same module into a single use statement. Conversely, imports from different modules are split into separate statements.
  • item: Flatten imports so that each has its own use statement.
  • one: Merge all imports into a single use statement as long as they have the same visibility and attributes.
"crate"

Type: null or one of “preserve”, “crate”, “module”, “item”, “one”

Default: null

Declared by: