mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 11:20:54 +00:00
No edit if no body
This commit is contained in:
parent
061a643f64
commit
a0638e5f64
@ -63,7 +63,10 @@ pub(super) fn hints(
|
||||
} else {
|
||||
Some(config.lazy_text_edit(|| {
|
||||
let body = closure.body();
|
||||
let body_range = body.expect("Closure must have a body").syntax().text_range();
|
||||
let body_range = match body {
|
||||
Some(body) => body.syntax().text_range(),
|
||||
None => return TextEdit::builder().finish(),
|
||||
};
|
||||
let mut builder = TextEdit::builder();
|
||||
let insert_pos = param_list.syntax().text_range().end();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user