Merge clangd's inactiveRegions with existing diagnostics (#26737)
Closes: https://github.com/zed-industries/zed/issues/13089 This PR attempts to resolve the issues discussed in my previous PR #26146. Release Notes: - Fixed: `inactiveRegions` doesn't replace existing diagnostics anymore
This commit is contained in:
parent
8f1023360d
commit
d9dcc59334
6 changed files with 164 additions and 23 deletions
|
|
@ -1557,6 +1557,13 @@ impl Buffer {
|
|||
self.send_operation(op, true, cx);
|
||||
}
|
||||
|
||||
pub fn get_diagnostics(&self, server_id: LanguageServerId) -> Option<&DiagnosticSet> {
|
||||
let Ok(idx) = self.diagnostics.binary_search_by_key(&server_id, |v| v.0) else {
|
||||
return None;
|
||||
};
|
||||
Some(&self.diagnostics[idx].1)
|
||||
}
|
||||
|
||||
fn request_autoindent(&mut self, cx: &mut Context<Self>) {
|
||||
if let Some(indent_sizes) = self.compute_autoindents() {
|
||||
let indent_sizes = cx.background_spawn(indent_sizes);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue