aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/handlers.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-06-13 20:17:05 +0100
committerAleksey Kladov <[email protected]>2021-06-13 20:17:36 +0100
commit500c909c76a5165e3e3c6ff2eacc009c90f08bbe (patch)
tree5b57ca5243009f6a63cb6f3d37acb524b8cd2c80 /crates/rust-analyzer/src/handlers.rs
parentb404b91da68556141ad39fffcef2865f073dd3d1 (diff)
internal: diagnostic code is mandatory
Diffstat (limited to 'crates/rust-analyzer/src/handlers.rs')
-rw-r--r--crates/rust-analyzer/src/handlers.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs
index a81e398c4..ccf66294f 100644
--- a/crates/rust-analyzer/src/handlers.rs
+++ b/crates/rust-analyzer/src/handlers.rs
@@ -1229,14 +1229,13 @@ pub(crate) fn publish_diagnostics(
1229 .map(|d| Diagnostic { 1229 .map(|d| Diagnostic {
1230 range: to_proto::range(&line_index, d.range), 1230 range: to_proto::range(&line_index, d.range),
1231 severity: Some(to_proto::diagnostic_severity(d.severity)), 1231 severity: Some(to_proto::diagnostic_severity(d.severity)),
1232 code: d.code.map(|d| d.as_str().to_owned()).map(NumberOrString::String), 1232 code: Some(NumberOrString::String(d.code.as_str().to_string())),
1233 code_description: d.code.and_then(|code| { 1233 code_description: Some(lsp_types::CodeDescription {
1234 lsp_types::Url::parse(&format!( 1234 href: lsp_types::Url::parse(&format!(
1235 "https://rust-analyzer.github.io/manual.html#{}", 1235 "https://rust-analyzer.github.io/manual.html#{}",
1236 code.as_str() 1236 d.code.as_str()
1237 )) 1237 ))
1238 .ok() 1238 .unwrap(),
1239 .map(|href| lsp_types::CodeDescription { href })
1240 }), 1239 }),
1241 source: Some("rust-analyzer".to_string()), 1240 source: Some("rust-analyzer".to_string()),
1242 message: d.message, 1241 message: d.message,