Extract the import code into the shared module

This commit is contained in:
Kirill Bulatov 2020-11-24 23:25:13 +02:00
parent 0993f9067c
commit f4ae3650d8
30 changed files with 298 additions and 254 deletions

View file

@ -1,7 +1,7 @@
//! Renderer for `enum` variants.
use assists::utils::{ImportScope, MergeBehaviour};
use hir::{HasAttrs, HirDisplay, ModPath, StructKind};
use ide_helpers::insert_use::{ImportScope, MergeBehaviour};
use itertools::Itertools;
use test_utils::mark;

View file

@ -1,7 +1,7 @@
//! Renderer for function calls.
use assists::utils::{ImportScope, MergeBehaviour};
use hir::{HasSource, ModPath, Type};
use ide_helpers::insert_use::{ImportScope, MergeBehaviour};
use syntax::{ast::Fn, display::function_declaration};
use crate::{

View file

@ -1,7 +1,7 @@
//! Renderer for macro invocations.
use assists::utils::{ImportScope, MergeBehaviour};
use hir::{Documentation, HasSource, ModPath};
use ide_helpers::insert_use::{ImportScope, MergeBehaviour};
use syntax::display::macro_label;
use test_utils::mark;
@ -12,6 +12,7 @@ use crate::{
pub(crate) fn render_macro<'a>(
ctx: RenderContext<'a>,
// TODO kb add some object instead of a tuple?
import_data: Option<(ModPath, ImportScope, Option<MergeBehaviour>)>,
name: String,
macro_: hir::MacroDef,