Fix config keys regarding imports in docs
This commit is contained in:
parent
5342f47f42
commit
eaebead296
@ -40,7 +40,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
|
|||||||
//
|
//
|
||||||
// .Import Granularity
|
// .Import Granularity
|
||||||
//
|
//
|
||||||
// It is possible to configure how use-trees are merged with the `importGranularity` setting.
|
// It is possible to configure how use-trees are merged with the `imports.granularity.group` setting.
|
||||||
// It has the following configurations:
|
// It has the following configurations:
|
||||||
//
|
//
|
||||||
// - `crate`: Merge imports from the same crate into a single use statement. This kind of
|
// - `crate`: Merge imports from the same crate into a single use statement. This kind of
|
||||||
@ -50,11 +50,11 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
|
|||||||
// - `preserve`: Do not change the granularity of any imports. For auto-import this has the same
|
// - `preserve`: Do not change the granularity of any imports. For auto-import this has the same
|
||||||
// effect as `item`.
|
// effect as `item`.
|
||||||
//
|
//
|
||||||
// In `VS Code` the configuration for this is `rust-analyzer.assist.importGranularity`.
|
// In `VS Code` the configuration for this is `rust-analyzer.imports.granularity.group`.
|
||||||
//
|
//
|
||||||
// .Import Prefix
|
// .Import Prefix
|
||||||
//
|
//
|
||||||
// The style of imports in the same crate is configurable through the `importPrefix` setting.
|
// The style of imports in the same crate is configurable through the `imports.prefix` setting.
|
||||||
// It has the following configurations:
|
// It has the following configurations:
|
||||||
//
|
//
|
||||||
// - `crate`: This setting will force paths to be always absolute, starting with the `crate`
|
// - `crate`: This setting will force paths to be always absolute, starting with the `crate`
|
||||||
@ -64,7 +64,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
|
|||||||
// `super` or an extern crate identifier.
|
// `super` or an extern crate identifier.
|
||||||
// - `plain`: This setting does not impose any restrictions in imports.
|
// - `plain`: This setting does not impose any restrictions in imports.
|
||||||
//
|
//
|
||||||
// In `VS Code` the configuration for this is `rust-analyzer.assist.importPrefix`.
|
// In `VS Code` the configuration for this is `rust-analyzer.imports.prefix`.
|
||||||
//
|
//
|
||||||
// image::https://user-images.githubusercontent.com/48062697/113020673-b85be580-917a-11eb-9022-59585f35d4f8.gif[]
|
// image::https://user-images.githubusercontent.com/48062697/113020673-b85be580-917a-11eb-9022-59585f35d4f8.gif[]
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ use super::Completions;
|
|||||||
//
|
//
|
||||||
// .Import configuration
|
// .Import configuration
|
||||||
//
|
//
|
||||||
// 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 `imports.granularity.group` setting.
|
||||||
// Mimics the corresponding behavior of the `Auto Import` feature.
|
// Mimics the corresponding behavior of the `Auto Import` feature.
|
||||||
//
|
//
|
||||||
// .LSP and performance implications
|
// .LSP and performance implications
|
||||||
|
@ -308,9 +308,11 @@ nvim_lsp.rust_analyzer.setup({
|
|||||||
on_attach=on_attach,
|
on_attach=on_attach,
|
||||||
settings = {
|
settings = {
|
||||||
["rust-analyzer"] = {
|
["rust-analyzer"] = {
|
||||||
assist = {
|
imports = {
|
||||||
importGranularity = "module",
|
granularity = {
|
||||||
importPrefix = "self",
|
group = "module",
|
||||||
|
},
|
||||||
|
prefix = "self",
|
||||||
},
|
},
|
||||||
cargo = {
|
cargo = {
|
||||||
loadOutDirsFromCheck = true
|
loadOutDirsFromCheck = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user