Skip to content

Commit

Permalink
Auto merge of rust-lang#12229 - Veykril:configfix, r=Veykril
Browse files Browse the repository at this point in the history
fix: Fix vscode config descriptions not recognizing all valid values
  • Loading branch information
bors committed May 12, 2022
2 parents 1491013 + d57beac commit f8c0062
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 72 deletions.
80 changes: 58 additions & 22 deletions crates/rust-analyzer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1683,21 +1683,39 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json
"maximum": 255
},
"LifetimeElisionDef" => set! {
"type": ["string", "boolean"],
"enum": ["always", "never", "skip_trivial"],
"enumDescriptions": [
"Always show lifetime elision hints.",
"Never show lifetime elision hints.",
"Only show lifetime elision hints if a return type is involved."
"anyOf": [
{
"type": "string",
"enum": [
"always",
"never",
"skip_trivial"
],
"enumDescriptions": [
"Always show lifetime elision hints.",
"Never show lifetime elision hints.",
"Only show lifetime elision hints if a return type is involved."
]
},
{ "type": "boolean" }
],
},
"ReborrowHintsDef" => set! {
"type": ["string", "boolean"],
"enum": ["always", "never", "mutable"],
"enumDescriptions": [
"Always show reborrow hints.",
"Never show reborrow hints.",
"Only show mutable reborrow hints."
"anyOf": [
{
"type": "string",
"enum": [
"always",
"never",
"mutable"
],
"enumDescriptions": [
"Always show reborrow hints.",
"Never show reborrow hints.",
"Only show mutable reborrow hints."
]
},
{ "type": "boolean" }
],
},
"CargoFeatures" => set! {
Expand All @@ -1709,19 +1727,37 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json
],
},
"Option<CargoFeatures>" => set! {
"type": ["string", "array", "null"],
"items": { "type": "string" },
"enum": ["all"],
"enumDescriptions": [
"Pass `--all-features` to cargo",
"anyOf": [
{
"type": "string",
"enum": [
"all"
],
"enumDescriptions": [
"Pass `--all-features` to cargo",
]
},
{
"type": "array",
"items": { "type": "string" }
},
{ "type": "null" }
],
},
"Option<CallableCompletionDef>" => set! {
"type": ["string", "null"],
"enum": ["fill_arguments", "add_parentheses"],
"enumDescriptions": [
"Add call parentheses and pre-fill arguments",
"Add call parentheses",
"anyOf": [
{
"type": "string",
"enum": [
"fill_arguments",
"add_parentheses"
],
"enumDescriptions": [
"Add call parentheses and pre-fill arguments",
"Add call parentheses"
]
},
{ "type": "null" }
],
},
"SignatureDetail" => set! {
Expand Down
118 changes: 68 additions & 50 deletions editors/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -491,19 +491,25 @@
"rust-analyzer.checkOnSave.features": {
"markdownDescription": "List of features to activate. Defaults to\n`#rust-analyzer.cargo.features#`.\n\nSet to `\"all\"` to pass `--all-features` to cargo.",
"default": null,
"type": [
"string",
"array",
"null"
],
"items": {
"type": "string"
},
"enum": [
"all"
],
"enumDescriptions": [
"Pass `--all-features` to cargo"
"anyOf": [
{
"type": "string",
"enum": [
"all"
],
"enumDescriptions": [
"Pass `--all-features` to cargo"
]
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"rust-analyzer.checkOnSave.noDefaultFeatures": {
Expand Down Expand Up @@ -546,17 +552,21 @@
"rust-analyzer.completion.callable.snippets": {
"markdownDescription": "Whether to add parenthesis and argument snippets when completing function.",
"default": "fill_arguments",
"type": [
"string",
"null"
],
"enum": [
"fill_arguments",
"add_parentheses"
],
"enumDescriptions": [
"Add call parentheses and pre-fill arguments",
"Add call parentheses"
"anyOf": [
{
"type": "string",
"enum": [
"fill_arguments",
"add_parentheses"
],
"enumDescriptions": [
"Add call parentheses and pre-fill arguments",
"Add call parentheses"
]
},
{
"type": "null"
}
]
},
"rust-analyzer.completion.postfix.enable": {
Expand Down Expand Up @@ -787,19 +797,23 @@
"rust-analyzer.inlayHints.lifetimeElisionHints.enable": {
"markdownDescription": "Whether to show inlay type hints for elided lifetimes in function signatures.",
"default": "never",
"type": [
"string",
"boolean"
],
"enum": [
"always",
"never",
"skip_trivial"
],
"enumDescriptions": [
"Always show lifetime elision hints.",
"Never show lifetime elision hints.",
"Only show lifetime elision hints if a return type is involved."
"anyOf": [
{
"type": "string",
"enum": [
"always",
"never",
"skip_trivial"
],
"enumDescriptions": [
"Always show lifetime elision hints.",
"Never show lifetime elision hints.",
"Only show lifetime elision hints if a return type is involved."
]
},
{
"type": "boolean"
}
]
},
"rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames": {
Expand All @@ -824,19 +838,23 @@
"rust-analyzer.inlayHints.reborrowHints.enable": {
"markdownDescription": "Whether to show inlay type hints for compiler inserted reborrows.",
"default": "never",
"type": [
"string",
"boolean"
],
"enum": [
"always",
"never",
"mutable"
],
"enumDescriptions": [
"Always show reborrow hints.",
"Never show reborrow hints.",
"Only show mutable reborrow hints."
"anyOf": [
{
"type": "string",
"enum": [
"always",
"never",
"mutable"
],
"enumDescriptions": [
"Always show reborrow hints.",
"Never show reborrow hints.",
"Only show mutable reborrow hints."
]
},
{
"type": "boolean"
}
]
},
"rust-analyzer.inlayHints.renderColons": {
Expand Down

0 comments on commit f8c0062

Please sign in to comment.