From 68f68534c6e3556a91832c1ac2b6d8e1a57ffca7 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 7 Jul 2021 19:42:09 +0200 Subject: [PATCH] Don't add the trait name to the insert text in completions --- crates/ide_completion/src/item.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/ide_completion/src/item.rs b/crates/ide_completion/src/item.rs index 29bc3d3727f..2d3242aa1e7 100644 --- a/crates/ide_completion/src/item.rs +++ b/crates/ide_completion/src/item.rs @@ -437,6 +437,7 @@ pub(crate) fn build(self) -> CompletionItem { format_to!(label, " (use {})", original_path) } } else if let Some(trait_name) = self.trait_name { + insert_text = insert_text.or_else(|| Some(label.clone())); format_to!(label, " (as {})", trait_name) }