aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-13 12:04:42 +0100
committerGitHub <[email protected]>2020-06-13 12:04:42 +0100
commit1c841c8a98040867edbb0a7d41381db9378ee3c2 (patch)
treea12ae54c0ecc32fc2a9145982ce776e7a50eec4c /crates
parentb56ad148db0c69eb279c225f45d324b4e80e7367 (diff)
parent66291d19f9bedf589b042971b9e89a04e1c5fe72 (diff)
Merge #4862
4862: Revert "Hide squiggly for unused and unnecessary" r=matklad a=GabbeV This reverts https://github.com/rust-analyzer/rust-analyzer/pull/4721 Co-authored-by: Gabriel Valfridsson <[email protected]>
Diffstat (limited to 'crates')
-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, 2 insertions, 3 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 f0273315e..9a7972ff5 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 Hint, 32 Warning,
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 04e286780..257910e09 100644
--- a/crates/rust-analyzer/src/diagnostics/to_proto.rs
+++ b/crates/rust-analyzer/src/diagnostics/to_proto.rs
@@ -184,7 +184,7 @@ pub(crate) fn map_rust_diagnostic_to_lsp(
184 return Vec::new(); 184 return Vec::new();
185 } 185 }
186 186
187 let mut severity = map_level_to_severity(rd.level); 187 let severity = map_level_to_severity(rd.level);
188 188
189 let mut source = String::from("rustc"); 189 let mut source = String::from("rustc");
190 let mut code = rd.code.as_ref().map(|c| c.code.clone()); 190 let mut code = rd.code.as_ref().map(|c| c.code.clone());
@@ -226,7 +226,6 @@ pub(crate) fn map_rust_diagnostic_to_lsp(
226 } 226 }
227 227
228 if is_unused_or_unnecessary(rd) { 228 if is_unused_or_unnecessary(rd) {
229 severity = Some(DiagnosticSeverity::Hint);
230 tags.push(DiagnosticTag::Unnecessary); 229 tags.push(DiagnosticTag::Unnecessary);
231 } 230 }
232 231