aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Valfridsson <[email protected]>2020-06-02 23:51:23 +0100
committerGabriel Valfridsson <[email protected]>2020-06-03 00:57:28 +0100
commit599c105e6fabb2b81c2d0a11b86c0c96f6ab1b88 (patch)
treea2c5e85a16dc375fd03fe9c08632ceab3f6145b2
parent2f6ab77708ae104c854712285af19516287b6906 (diff)
Hide squiggly for unused and unnecessary
-rw-r--r--crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_rustc_unused_variable.snap2
-rw-r--r--crates/rust-analyzer/src/diagnostics/to_proto.rs3
2 files changed, 3 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_rustc_unused_variable.snap b/crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_rustc_unused_variable.snap
index 6dd3fcb2e..33b516e26 100644
--- a/crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_rustc_unused_variable.snap
+++ b/crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_rustc_unused_variable.snap
@@ -29,7 +29,7 @@ expression: diag
29 }, 29 },
30 }, 30 },
31 severity: Some( 31 severity: Some(
32 Warning, 32 Hint,
33 ), 33 ),
34 code: Some( 34 code: Some(
35 String( 35 String(
diff --git a/crates/rust-analyzer/src/diagnostics/to_proto.rs b/crates/rust-analyzer/src/diagnostics/to_proto.rs
index a500d670a..6a6e7b457 100644
--- a/crates/rust-analyzer/src/diagnostics/to_proto.rs
+++ b/crates/rust-analyzer/src/diagnostics/to_proto.rs
@@ -183,7 +183,7 @@ pub(crate) fn map_rust_diagnostic_to_lsp(
183 return Vec::new(); 183 return Vec::new();
184 } 184 }
185 185
186 let severity = map_level_to_severity(rd.level); 186 let mut severity = map_level_to_severity(rd.level);
187 187
188 let mut source = String::from("rustc"); 188 let mut source = String::from("rustc");
189 let mut code = rd.code.as_ref().map(|c| c.code.clone()); 189 let mut code = rd.code.as_ref().map(|c| c.code.clone());
@@ -225,6 +225,7 @@ pub(crate) fn map_rust_diagnostic_to_lsp(
225 } 225 }
226 226
227 if is_unused_or_unnecessary(rd) { 227 if is_unused_or_unnecessary(rd) {
228 severity = Some(DiagnosticSeverity::Hint);
228 tags.push(DiagnosticTag::Unnecessary); 229 tags.push(DiagnosticTag::Unnecessary);
229 } 230 }
230 231