Hide squiggly for unused and unnecessary
This commit is contained in:
@@ -29,7 +29,7 @@ expression: diag
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
severity: Some(
|
severity: Some(
|
||||||
Warning,
|
Hint,
|
||||||
),
|
),
|
||||||
code: Some(
|
code: Some(
|
||||||
String(
|
String(
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ pub(crate) fn map_rust_diagnostic_to_lsp(
|
|||||||
return Vec::new();
|
return Vec::new();
|
||||||
}
|
}
|
||||||
|
|
||||||
let severity = map_level_to_severity(rd.level);
|
let mut severity = map_level_to_severity(rd.level);
|
||||||
|
|
||||||
let mut source = String::from("rustc");
|
let mut source = String::from("rustc");
|
||||||
let mut code = rd.code.as_ref().map(|c| c.code.clone());
|
let mut code = rd.code.as_ref().map(|c| c.code.clone());
|
||||||
@@ -225,6 +225,7 @@ pub(crate) fn map_rust_diagnostic_to_lsp(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if is_unused_or_unnecessary(rd) {
|
if is_unused_or_unnecessary(rd) {
|
||||||
|
severity = Some(DiagnosticSeverity::Hint);
|
||||||
tags.push(DiagnosticTag::Unnecessary);
|
tags.push(DiagnosticTag::Unnecessary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user