aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2020-11-18 07:54:52 +0000
committerLukas Wirth <[email protected]>2020-11-18 07:54:52 +0000
commit91a1a836015f61accb73f7b855b852fc22e810fc (patch)
treeda87cf6a9a6ce3347e47acd9fe0e250b589c4922 /crates
parent56a0021e61e67838b2f258697471ec07b2f3b723 (diff)
Fill code_description for rust_analyzer diagnostics
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/handlers.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs
index 118e7276f..1cf4139d2 100644
--- a/crates/rust-analyzer/src/handlers.rs
+++ b/crates/rust-analyzer/src/handlers.rs
@@ -1129,7 +1129,14 @@ pub(crate) fn publish_diagnostics(
1129 range: to_proto::range(&line_index, d.range), 1129 range: to_proto::range(&line_index, d.range),
1130 severity: Some(to_proto::diagnostic_severity(d.severity)), 1130 severity: Some(to_proto::diagnostic_severity(d.severity)),
1131 code: d.code.map(|d| d.as_str().to_owned()).map(NumberOrString::String), 1131 code: d.code.map(|d| d.as_str().to_owned()).map(NumberOrString::String),
1132 code_description: None, 1132 code_description: d.code.and_then(|code| {
1133 lsp_types::Url::parse(&format!(
1134 "https://rust-analyzer.github.io/manual.html#{}",
1135 code.as_str()
1136 ))
1137 .ok()
1138 .map(|href| lsp_types::CodeDescription { href })
1139 }),
1133 source: Some("rust-analyzer".to_string()), 1140 source: Some("rust-analyzer".to_string()),
1134 message: d.message, 1141 message: d.message,
1135 related_information: None, 1142 related_information: None,