diagnostics: add }; only if { was added too
This commit is contained in:
@@ -2161,6 +2161,11 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
||||
format!("{{{}, {}", import_snippet, start_snippet)
|
||||
},
|
||||
));
|
||||
|
||||
// Add a `};` to the end if nested, matching the `{` added at the start.
|
||||
if !has_nested {
|
||||
corrections.push((source_map.end_point(after_crate_name), "};".to_string()));
|
||||
}
|
||||
} else {
|
||||
// If the root import is module-relative, add the import separately
|
||||
corrections.push((
|
||||
@@ -2168,11 +2173,6 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
||||
format!("use {module_name}::{import_snippet};\n"),
|
||||
));
|
||||
}
|
||||
|
||||
// Add a `};` to the end if nested, matching the `{` added at the start.
|
||||
if !has_nested {
|
||||
corrections.push((source_map.end_point(after_crate_name), "};".to_string()));
|
||||
}
|
||||
}
|
||||
|
||||
let suggestion = Some((
|
||||
|
||||
Reference in New Issue
Block a user