feat(diagnostics): use default expression instead of todo! when missing fields

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
This commit is contained in:
Benjamin Coenen 2022-01-07 15:01:37 +01:00
parent b60a29ca94
commit 8e0a05eb70
3 changed files with 6 additions and 6 deletions

View file

@ -45,7 +45,7 @@ use crate::{
// parsing the old name. // parsing the old name.
config_data! { config_data! {
struct ConfigData { struct ConfigData {
/// How assists will fill missing elements in an expression. /// Placeholder for missing expressions in assists.
assist_exprFillDefault: ExprFillDefaultDef = "\"todo\"", assist_exprFillDefault: ExprFillDefaultDef = "\"todo\"",
/// How imports should be grouped into use statements. /// How imports should be grouped into use statements.
assist_importGranularity | assist_importGranularity |
@ -1272,7 +1272,7 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json
"type": "string", "type": "string",
"enum": ["todo", "default"], "enum": ["todo", "default"],
"enumDescriptions": [ "enumDescriptions": [
"Fill missing expressions with the 'todo' macro", "Fill missing expressions with the `todo` macro",
"Fill missing expressions with reasonable defaults, `new` or `default` constructors." "Fill missing expressions with reasonable defaults, `new` or `default` constructors."
], ],
}, },

View file

@ -1,7 +1,7 @@
[[rust-analyzer.assist.exprFillDefault]]rust-analyzer.assist.exprFillDefault (default: `"todo"`):: [[rust-analyzer.assist.exprFillDefault]]rust-analyzer.assist.exprFillDefault (default: `"todo"`)::
+ +
-- --
How assists will fill missing elements in an expression. Placeholder for missing expressions in assists.
-- --
[[rust-analyzer.assist.importGranularity]]rust-analyzer.assist.importGranularity (default: `"crate"`):: [[rust-analyzer.assist.importGranularity]]rust-analyzer.assist.importGranularity (default: `"crate"`)::
+ +

View file

@ -379,7 +379,7 @@
}, },
"$generated-start": {}, "$generated-start": {},
"rust-analyzer.assist.exprFillDefault": { "rust-analyzer.assist.exprFillDefault": {
"markdownDescription": "How assists will fill missing elements in an expression.", "markdownDescription": "Placeholder for missing expressions in assists.",
"default": "todo", "default": "todo",
"type": "string", "type": "string",
"enum": [ "enum": [
@ -387,7 +387,7 @@
"default" "default"
], ],
"enumDescriptions": [ "enumDescriptions": [
"Fill missing expressions with the 'todo' macro", "Fill missing expressions with the `todo` macro",
"Fill missing expressions with reasonable defaults, `new` or `default` constructors." "Fill missing expressions with reasonable defaults, `new` or `default` constructors."
] ]
}, },
@ -1507,4 +1507,4 @@
] ]
} }
} }
} }