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
|
@ -255,7 +255,12 @@ impl LspAdapter for RustLspAdapter {
|
|||
Some("rust-analyzer/flycheck".into())
|
||||
}
|
||||
|
||||
fn process_diagnostics(&self, params: &mut lsp::PublishDiagnosticsParams) {
|
||||
fn process_diagnostics(
|
||||
&self,
|
||||
params: &mut lsp::PublishDiagnosticsParams,
|
||||
_: LanguageServerId,
|
||||
_: Option<&'_ Buffer>,
|
||||
) {
|
||||
static REGEX: LazyLock<Regex> =
|
||||
LazyLock::new(|| Regex::new(r"(?m)`([^`]+)\n`$").expect("Failed to create REGEX"));
|
||||
|
||||
|
@ -959,7 +964,7 @@ mod tests {
|
|||
},
|
||||
],
|
||||
};
|
||||
RustLspAdapter.process_diagnostics(&mut params);
|
||||
RustLspAdapter.process_diagnostics(&mut params, LanguageServerId(0), None);
|
||||
|
||||
assert_eq!(params.diagnostics[0].message, "use of moved value `a`");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue