diff options
-rw-r--r-- | crates/rust-analyzer/src/handlers.rs | 9 |
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, |