Clip points coming from language server
This avoids panicking in Zed if the points they give us are invalid. Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
parent
d12387b753
commit
ce8741977b
2 changed files with 8 additions and 2 deletions
|
@ -711,7 +711,9 @@ impl Buffer {
|
|||
end = last_edit_new_end + (end - last_edit_old_end);
|
||||
}
|
||||
|
||||
Some((start..end, (severity, diagnostic.message)))
|
||||
let range =
|
||||
content.clip_point(start, Bias::Left)..content.clip_point(end, Bias::Right);
|
||||
Some((range, (severity, diagnostic.message)))
|
||||
}),
|
||||
)
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue