Start on a DiagnosticProvider implementation for Rust

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-12-24 16:22:22 +01:00
parent 393009a05c
commit a85e400b35
6 changed files with 138 additions and 10 deletions

View file

@ -805,10 +805,13 @@ impl Buffer {
}
}
let start_overshoot = start - last_edit_old_end;
start = last_edit_new_end;
start.add_assign(&(start - last_edit_old_end));
start.add_assign(&start_overshoot);
let end_overshoot = end - last_edit_old_end;
end = last_edit_new_end;
end.add_assign(&(end - last_edit_old_end));
end.add_assign(&end_overshoot);
}
let range = start.clip(Bias::Left, content)..end.clip(Bias::Right, content);