We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents de50ef4 + 09ce5d8 commit 4fe10b7Copy full SHA for 4fe10b7
crates/ide_completion/src/completions/postfix.rs
@@ -225,6 +225,10 @@ fn build_postfix_snippet_builder<'ctx>(
225
) -> Option<impl Fn(&str, &str, &str) -> Builder + 'ctx> {
226
let receiver_syntax = receiver.syntax();
227
let receiver_range = ctx.sema.original_range_opt(receiver_syntax)?.range;
228
+ if ctx.source_range().end() < receiver_range.start() {
229
+ // This shouldn't happen, yet it does. I assume this might be due to an incorrect token mapping.
230
+ return None;
231
+ }
232
let delete_range = TextRange::new(receiver_range.start(), ctx.source_range().end());
233
234
// Wrapping impl Fn in an option ruins lifetime inference for the parameters in a way that
0 commit comments