Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Make sure GoPlsAdapter produces output that can be rendered as Markdown (#30911)

Mikal Sande206be2b3480a
diff --git a/crates/languages/src/go.rs b/crates/languages/src/go.rs
index bbe0285fc5a..f4f6950facd 100644
--- a/crates/languages/src/go.rs
+++ b/crates/languages/src/go.rs
@@ -374,6 +374,12 @@ impl super::LspAdapter for GoLspAdapter {
filter_range,
})
}
+
+ fn diagnostic_message_to_markdown(&self, message: &str) -> Option<String> {
+ static REGEX: LazyLock<Regex> =
+ LazyLock::new(|| Regex::new(r"(?m)\n\s*").expect("Failed to create REGEX"));
+ Some(REGEX.replace_all(message, "\n\n").to_string())
+ }
}
fn parse_version_output(output: &Output) -> Result<&str> {