-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
"Try wrapping the expression" action wraps in all viable types #19282
Comments
Hmm, it's strange. In Helix I don't get the action at first, but it does show up after |
My bad, we do take |
I'm not too familiar with how
|
It suggests both changes in the same place: "children": [
{
"children": [],
"code": null,
"level": "help",
"message": "try wrapping the expression in a variant of `Thing`",
"rendered": null,
"spans": [
{
"byte_end": 76,
"byte_start": 76,
"column_end": 5,
"column_start": 5,
"expansion": null,
"file_name": "src/main.rs",
"is_primary": true,
"label": null,
"line_end": 7,
"line_start": 7,
"suggested_replacement": "Thing::Foo(",
"suggestion_applicability": "MaybeIncorrect",
"text": [
{
"highlight_end": 5,
"highlight_start": 5,
"text": " String::new()"
}
]
},
{
"byte_end": 89,
"byte_start": 89,
"column_end": 18,
"column_start": 18,
"expansion": null,
"file_name": "src/main.rs",
"is_primary": true,
"label": null,
"line_end": 7,
"line_start": 7,
"suggested_replacement": ")",
"suggestion_applicability": "MaybeIncorrect",
"text": [
{
"highlight_end": 18,
"highlight_start": 18,
"text": " String::new()"
}
]
},
{
"byte_end": 76,
"byte_start": 76,
"column_end": 5,
"column_start": 5,
"expansion": null,
"file_name": "src/main.rs",
"is_primary": true,
"label": null,
"line_end": 7,
"line_start": 7,
"suggested_replacement": "Thing::Bar(",
"suggestion_applicability": "MaybeIncorrect",
"text": [
{
"highlight_end": 5,
"highlight_start": 5,
"text": " String::new()"
}
]
},
{
"byte_end": 89,
"byte_start": 89,
"column_end": 18,
"column_start": 18,
"expansion": null,
"file_name": "src/main.rs",
"is_primary": true,
"label": null,
"line_end": 7,
"line_start": 7,
"suggested_replacement": ")",
"suggestion_applicability": "MaybeIncorrect",
"text": [
{
"highlight_end": 18,
"highlight_start": 18,
"text": " String::new()"
}
]
}
]
}
], |
It seems like it would be pretty hard for |
Yes it looks like a rustc issue. |
rust-analyzer version:
rust-analyzer 1.84.0 (9fc6b43 2025-01-07)
rustc version:
rustc 1.84.0 (9fc6b4312 2025-01-07)
editor or extension:
helix 25.01.1 (7275b7f8)
relevant settings: None?
code snippet to reproduce:
rust-analyzer
suggests:Taking this action results in:
Should "Wrap in Thing::Foo" and "Wrap in Thing::Bar" be separate actions?
The text was updated successfully, but these errors were encountered: