Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs')
-rw-r--r--crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs b/crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs
index a470ce72fc..6d756484eb 100644
--- a/crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs
+++ b/crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs
@@ -4,6 +4,7 @@ use ide_db::{
label::Label,
source_change::SourceChangeBuilder,
};
+use syntax::ToSmolStr;
use text_edit::TextRange;
use crate::{Diagnostic, DiagnosticCode, DiagnosticsContext};
@@ -21,7 +22,7 @@ pub(crate) fn trait_impl_redundant_assoc_item(
let assoc_item = d.assoc_item.1;
let default_range = d.impl_.syntax_node_ptr().text_range();
- let trait_name = d.trait_.name(db).to_smol_str();
+ let trait_name = d.trait_.name(db).display_no_db().to_smolstr();
let (redundant_item_name, diagnostic_range, redundant_item_def) = match assoc_item {
hir::AssocItem::Function(id) => {
@@ -45,7 +46,10 @@ pub(crate) fn trait_impl_redundant_assoc_item(
(
format!("`type {redundant_assoc_item_name}`"),
type_alias.source(db).map(|it| it.syntax().text_range()).unwrap_or(default_range),
- format!("\n type {};", type_alias.name(ctx.sema.db).to_smol_str()),
+ format!(
+ "\n type {};",
+ type_alias.name(ctx.sema.db).display_no_db().to_smolstr()
+ ),
)
}
};
@@ -98,7 +102,7 @@ fn quickfix_for_redundant_assoc_item(
group: None,
target: range,
source_change: Some(source_change_builder.finish()),
- trigger_signature_help: false,
+ command: None,
}])
}