Add an option to remove reborrows from adjustment inlay hints

Reborrows are consecutive deref then ref. Make it the default because reborrows are mostly useless to the programmer.

Also rename `rust-analyzer.inlayHints.expressionAdjustmentHints.enable: "reborrow"` to `rust-analyzer.inlayHints.expressionAdjustmentHints.enable: "borrows"`, as it's not about reborrows but about any ref/deref and it's confusing with the new setting.
This commit is contained in:
Chayim Refael Friedman 2025-08-24 02:26:37 +03:00
parent e6cd085099
commit eaf71411a9
7 changed files with 88 additions and 5 deletions

View file

@ -2209,6 +2209,16 @@
}
}
},
{
"title": "Inlay Hints",
"properties": {
"rust-analyzer.inlayHints.expressionAdjustmentHints.disableReborrows": {
"markdownDescription": "Disable reborrows in expression adjustments inlay hints.\n\nReborrows are a pair of a builtin deref then borrow, i.e. `&*`. They are inserted by the compiler but are mostly useless to the programmer.\n\nNote: if the deref is not builtin (an overloaded deref), or the borrow is `&raw const`/`&raw mut`, they are not removed.",
"default": true,
"type": "boolean"
}
}
},
{
"title": "Inlay Hints",
"properties": {