-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: Add an option to hide reborrows in adjustment inlay hints #20520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
ShoyuVanilla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit surprising that current "Reborrows" option has been enabling everything except pointer cast and never to any adjustments 😅
| #[derive(Clone, Debug, PartialEq, Eq)] | ||
| pub enum AdjustmentHints { | ||
| Always, | ||
| ReborrowOnly, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note this breaks user configs using the old key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the inlay hints parameter, the real config has #[serde(alias)] for this reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I just used the pre-release and got an error about unrecognized config though
| #[serde(rename_all = "snake_case")] | ||
| enum AdjustmentHintsDef { | ||
| Reborrow, | ||
| #[serde(alias = "Reborrow")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh maybe this must be reborrow? Not sure if rename_all applies to aliases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not. I even thought about that, but somehow still wrote Reborrow. Created #20606 for that.
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"torust-analyzer.inlayHints.expressionAdjustmentHints.enable: "borrows", as it's not about reborrows but about any ref/deref and it's confusing with the new setting.Closes #20516.