Better bias selection for hints that prefix the type

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
This commit is contained in:
Kirill Bulatov 2023-06-12 11:32:41 +03:00
parent 2b1b1225f5
commit 63074c5cd8
4 changed files with 79 additions and 42 deletions

View file

@ -305,10 +305,10 @@ impl DisplayMap {
let mut new_inlays = Vec::new();
for (&location, hints) in new_hints {
for hint in hints {
let hint_anchor =
let mut hint_anchor =
buffer_snapshot.anchor_in_excerpt(location.excerpt_id, hint.position);
new_inlays.push(InlayProperties {
position: hint_anchor,
position: hint_anchor.bias_left(&buffer_snapshot),
text: hint.text(),
});
}