In the inferred type hints, expand the line too long. add config to disable it.
Example
---
```json
{"rust-analyzer.inlayHints.typeHints.hideInferredTypes": true}
```
```rust
use std::collections::HashMap;
fn foo(iter: Vec<Result<HashMap<String, String>, std::io::Error>>) {
let output = iter.into_iter().collect::<Result<Vec<_>, _>>().unwrap();
}
```
**Before this PR**
```rust
let output: Vec<HashMap<String, String>> = iter.into_iter().collect::<Result<Vec<_ = HashMap<String, String>>, _ = Error>>().unwrap();
```
**After this PR**
```rust
let output: Vec<HashMap<String, String>> = iter.into_iter().collect::<Result<Vec<_>, _>>().unwrap();
```
I don't do it by default, for three reasons: (1) it's more expensive, (2) I actually quite like seeing the derives, and they may expand to no impl/more than one impl, (3) if #19130 will ever be merged this will become even more useful.
Even a config might be too much, but it was fun and easy to code so I did that.
It didn't do anything (behaved like `item`), as with `enforceGranularity = false` (which is the default), the style of the current file is always preferred, regardless of the setting.
We could make it fail when the setting is `preserve` and the current file's style could not be detected, but that makes little sense.
It is a bit weird that the default is `crate` but `preserve` falls back to `item`, however that was the previous behavior.
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.
- All settings are now phrased in the imperative form stating what the
setting does rather than talking about what it controls. (E.g.:
"Show `Debug` action." instead of "Whether to show `Debug` action"
- Categories are now displayed in title case
- Categories are now sorted lexicographically
- General category is removed (and all the settings are moved to the top
level)
- Language for a few descriptions is made a bit less ambiguous
The current default plain, tends to create non-uniform import blocks over time, some being relative, some being absolute.
I believe we should encourage a different default here.
Also fix the `needs_drop()` intrinsic.
Unions also need this information (to err if they have a drop-needing field), but this will come in a follow-up PR.
I have no idea what the original writer of the code thought but the logic just seems backwards. We should not exclude a file/directory if it is equal to an include! This also meant that we had to add a `root == path` check so this stuff will actually work, which in turn meant excludes (of root files) no longer worked...
Also rename if to `rust-analyzer.files.exclude`, because it can exclude files as well.