Use specific kind for the flyimport completions

This commit is contained in:
Kirill Bulatov 2021-01-16 19:40:59 +02:00
parent 6742f38e49
commit 7ae1309ac5

View file

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