diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-16 15:53:06 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-16 15:53:06 +0100 |
commit | f6e73d510da3a7b2582fdf629fcfda4dca9c7b06 (patch) | |
tree | 035e1e28ebbb0a3669e9c366caa738f969fdb9cc | |
parent | 88c2e5995e6d4ab2096848d3af60493e4077dff2 (diff) | |
parent | b58c1c9eb2b19479018add616592b73e3b933b77 (diff) |
Merge #9258
9258: minor: Give `ImportPrefix` variants better config names r=matklad a=Veykril
I feel like `crate` and `self` work better than `by_crate` and `by_self`. The only reason for the current names were that `Self` doesn't work for the variant name on the rust side so I forgot about setting proper config names on serde layer.
Co-authored-by: Lukas Wirth <[email protected]>
-rw-r--r-- | crates/rust-analyzer/src/config.rs | 10 | ||||
-rw-r--r-- | editors/code/package.json | 8 |
2 files changed, 10 insertions, 8 deletions
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 5588c15da..c4757a1cb 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs | |||
@@ -801,7 +801,9 @@ enum ImportGranularityDef { | |||
801 | #[serde(rename_all = "snake_case")] | 801 | #[serde(rename_all = "snake_case")] |
802 | enum ImportPrefixDef { | 802 | enum ImportPrefixDef { |
803 | Plain, | 803 | Plain, |
804 | #[serde(alias = "self")] | ||
804 | BySelf, | 805 | BySelf, |
806 | #[serde(alias = "crate")] | ||
805 | ByCrate, | 807 | ByCrate, |
806 | } | 808 | } |
807 | 809 | ||
@@ -986,13 +988,13 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json | |||
986 | "type": "string", | 988 | "type": "string", |
987 | "enum": [ | 989 | "enum": [ |
988 | "plain", | 990 | "plain", |
989 | "by_self", | 991 | "self", |
990 | "by_crate" | 992 | "crate" |
991 | ], | 993 | ], |
992 | "enumDescriptions": [ | 994 | "enumDescriptions": [ |
993 | "Insert import paths relative to the current module, using up to one `super` prefix if the parent module contains the requested item.", | 995 | "Insert import paths relative to the current module, using up to one `super` prefix if the parent module contains the requested item.", |
994 | "Prefix all import paths with `self` if they don't begin with `self`, `super`, `crate` or a crate name.", | 996 | "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.", |
995 | "Force import paths to be absolute by always starting them with `crate` or the crate name they refer to." | 997 | "Force import paths to be absolute by always starting them with `crate` or the extern crate name they come from." |
996 | ], | 998 | ], |
997 | }, | 999 | }, |
998 | "Vec<ManifestOrProjectJson>" => set! { | 1000 | "Vec<ManifestOrProjectJson>" => set! { |
diff --git a/editors/code/package.json b/editors/code/package.json index aa47bd0ed..1fac700be 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -418,13 +418,13 @@ | |||
418 | "type": "string", | 418 | "type": "string", |
419 | "enum": [ | 419 | "enum": [ |
420 | "plain", | 420 | "plain", |
421 | "by_self", | 421 | "self", |
422 | "by_crate" | 422 | "crate" |
423 | ], | 423 | ], |
424 | "enumDescriptions": [ | 424 | "enumDescriptions": [ |
425 | "Insert import paths relative to the current module, using up to one `super` prefix if the parent module contains the requested item.", | 425 | "Insert import paths relative to the current module, using up to one `super` prefix if the parent module contains the requested item.", |
426 | "Prefix all import paths with `self` if they don't begin with `self`, `super`, `crate` or a crate name.", | 426 | "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.", |
427 | "Force import paths to be absolute by always starting them with `crate` or the crate name they refer to." | 427 | "Force import paths to be absolute by always starting them with `crate` or the extern crate name they come from." |
428 | ] | 428 | ] |
429 | }, | 429 | }, |
430 | "rust-analyzer.assist.importGroup": { | 430 | "rust-analyzer.assist.importGroup": { |