mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Don't include empty suggestions
This commit is contained in:
parent
efe662d474
commit
30e472a12a
1 changed files with 3 additions and 1 deletions
|
@ -138,7 +138,9 @@ fn map_rust_child_diagnostic(
|
|||
let mut suggested_replacements = Vec::new();
|
||||
for &span in &spans {
|
||||
if let Some(suggested_replacement) = &span.suggested_replacement {
|
||||
if !suggested_replacement.is_empty() {
|
||||
suggested_replacements.push(suggested_replacement);
|
||||
}
|
||||
let location = location(config, workspace_root, span);
|
||||
let edit = lsp_types::TextEdit::new(location.range, suggested_replacement.clone());
|
||||
edit_map.entry(location.uri).or_default().push(edit);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue