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:
co-authored by
Max Brunsfeld
parent
d12387b753
commit
ce8741977b
@@ -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)))
|
||||
}),
|
||||
)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user