mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Make selections in assists with trailing/leading whitespace more forgiving
This commit is contained in:
parent
1cca1fa5bf
commit
03fcf1b246
14 changed files with 57 additions and 23 deletions
|
@ -56,7 +56,7 @@ type FxIndexSet<T> = indexmap::IndexSet<T, BuildHasherDefault<FxHasher>>;
|
|||
// }
|
||||
// ```
|
||||
pub(crate) fn extract_function(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
|
||||
let range = ctx.frange.range;
|
||||
let range = ctx.selection_trimmed();
|
||||
if range.is_empty() {
|
||||
return None;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue