mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-12-15 21:34:19 +00:00
Auto merge of #13359 - feniljain:feat-must-use-option, r=Veykril
feat: add config for inserting must_use in `generate_enum_as_method` Should fix #13312 Didn't add a test because I was not sure on how to add test for a specific configuration option, tried to look for the usages for other `AssistConfig` variants but couldn't find any in `tests`. If there is a way to test this, do point me towards it. I tried to extract the formatting string as a common `template_string` and only have if-else for that, but it didn't compile :( Also it seems these tests are failing: ``` test config::tests::generate_config_documentation ... FAILED test config::tests::generate_package_json_config ... FAILED ``` Can you also point me to how to correct these 😅 ( I guess there is some command to automatically generate these? )
This commit is contained in:
commit
af1f48deab
6 changed files with 32 additions and 4 deletions
|
|
@ -397,6 +397,11 @@
|
|||
"type": "boolean"
|
||||
},
|
||||
"$generated-start": {},
|
||||
"rust-analyzer.assist.emitMustUse": {
|
||||
"markdownDescription": "Whether to insert #[must_use] when generating `as_` methods\nfor enum variants.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"rust-analyzer.assist.expressionFillDefault": {
|
||||
"markdownDescription": "Placeholder expression to use for missing expressions in assists.",
|
||||
"default": "todo",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue