Make LspAdapter::process_diagnostics synchronous

Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2023-08-07 13:53:41 -07:00
parent e3a4d174de
commit 4e33654aba
3 changed files with 19 additions and 28 deletions

View file

@ -102,7 +102,7 @@ impl LspAdapter for RustLspAdapter {
Some("rust-analyzer/flycheck".into())
}
async fn process_diagnostics(&self, params: &mut lsp::PublishDiagnosticsParams) {
fn process_diagnostics(&self, params: &mut lsp::PublishDiagnosticsParams) {
lazy_static! {
static ref REGEX: Regex = Regex::new("(?m)`([^`]+)\n`$").unwrap();
}
@ -310,7 +310,7 @@ mod tests {
},
],
};
RustLspAdapter.process_diagnostics(&mut params).await;
RustLspAdapter.process_diagnostics(&mut params);
assert_eq!(params.diagnostics[0].message, "use of moved value `a`");