diff options
author | Mikhail Rakhmanov <[email protected]> | 2020-06-03 18:26:01 +0100 |
---|---|---|
committer | Mikhail Rakhmanov <[email protected]> | 2020-06-03 18:26:01 +0100 |
commit | 6a0083a519680e8d16bde5d7c1940c8dd6d4e9d4 (patch) | |
tree | 2b377141d722257cfea18e74b955aea1a8f6cc1a /crates/rust-analyzer/src/diagnostics | |
parent | 1f7de306f547ecb394a34445fd6ac1d6bc8ab439 (diff) | |
parent | 794f6da821c5d6e2490b996baffe162e4753262d (diff) |
Merge branch 'master' into compute-lazy-assits
# Conflicts:
# crates/rust-analyzer/src/main_loop/handlers.rs
# crates/rust-analyzer/src/to_proto.rs
Diffstat (limited to 'crates/rust-analyzer/src/diagnostics')
-rw-r--r-- | crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_rustc_unused_variable.snap | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/diagnostics/to_proto.rs | 3 |
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 9a7972ff5..f0273315e 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 257910e09..04e286780 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 severity = map_level_to_severity(rd.level); | 187 | let mut 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,6 +226,7 @@ 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); | ||
229 | tags.push(DiagnosticTag::Unnecessary); | 230 | tags.push(DiagnosticTag::Unnecessary); |
230 | } | 231 | } |
231 | 232 | ||