Give ImportPrefix variants better config names

This commit is contained in:
Lukas Wirth 2021-06-13 22:00:39 +02:00
parent 863e23f00f
commit b58c1c9eb2
2 changed files with 10 additions and 8 deletions

View file

@ -801,7 +801,9 @@ enum ImportGranularityDef {
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
enum ImportPrefixDef { enum ImportPrefixDef {
Plain, Plain,
#[serde(alias = "self")]
BySelf, BySelf,
#[serde(alias = "crate")]
ByCrate, ByCrate,
} }
@ -986,13 +988,13 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json
"type": "string", "type": "string",
"enum": [ "enum": [
"plain", "plain",
"by_self", "self",
"by_crate" "crate"
], ],
"enumDescriptions": [ "enumDescriptions": [
"Insert import paths relative to the current module, using up to one `super` prefix if the parent module contains the requested item.", "Insert import paths relative to the current module, using up to one `super` prefix if the parent module contains the requested item.",
"Prefix all import paths with `self` if they don't begin with `self`, `super`, `crate` or a crate name.", "Insert import paths relative to the current module, using up to one `super` prefix if the parent module contains the requested item. Prefixes `self` in front of the path if it starts with a module.",
"Force import paths to be absolute by always starting them with `crate` or the crate name they refer to." "Force import paths to be absolute by always starting them with `crate` or the extern crate name they come from."
], ],
}, },
"Vec<ManifestOrProjectJson>" => set! { "Vec<ManifestOrProjectJson>" => set! {

View file

@ -418,13 +418,13 @@
"type": "string", "type": "string",
"enum": [ "enum": [
"plain", "plain",
"by_self", "self",
"by_crate" "crate"
], ],
"enumDescriptions": [ "enumDescriptions": [
"Insert import paths relative to the current module, using up to one `super` prefix if the parent module contains the requested item.", "Insert import paths relative to the current module, using up to one `super` prefix if the parent module contains the requested item.",
"Prefix all import paths with `self` if they don't begin with `self`, `super`, `crate` or a crate name.", "Insert import paths relative to the current module, using up to one `super` prefix if the parent module contains the requested item. Prefixes `self` in front of the path if it starts with a module.",
"Force import paths to be absolute by always starting them with `crate` or the crate name they refer to." "Force import paths to be absolute by always starting them with `crate` or the extern crate name they come from."
] ]
}, },
"rust-analyzer.assist.importGroup": { "rust-analyzer.assist.importGroup": {