]> git.lizzy.rs Git - rust.git/commitdiff
Use specific kind for the flyimport completions
authorKirill Bulatov <mail4score@gmail.com>
Sat, 16 Jan 2021 17:40:59 +0000 (19:40 +0200)
committerKirill Bulatov <mail4score@gmail.com>
Sat, 16 Jan 2021 17:40:59 +0000 (19:40 +0200)
crates/completion/src/render.rs

index e93c59f717796611786654664880ec737b1283a4..820dd01d1f7e7855d1b76b406e1500b84bdef020 100644 (file)
@@ -51,11 +51,16 @@ pub(crate) fn render_resolution_with_import<'a>(
     import_edit: ImportEdit,
     resolution: &ScopeDef,
 ) -> Option<CompletionItem> {
-    Render::new(ctx).render_resolution(
-        import_edit.import_path.segments.last()?.to_string(),
-        Some(import_edit),
-        resolution,
-    )
+    Render::new(ctx)
+        .render_resolution(
+            import_edit.import_path.segments.last()?.to_string(),
+            Some(import_edit),
+            resolution,
+        )
+        .map(|mut item| {
+            item.completion_kind = CompletionKind::Magic;
+            item
+        })
 }
 
 /// Interface for data and methods required for items rendering.