aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/render.rs
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-12-04 14:03:22 +0000
committerKirill Bulatov <[email protected]>2020-12-07 21:41:08 +0000
commitdeda74edd89affb3f77d274776d2a672bc11db90 (patch)
treee9c7dac6df4fd06012ca6b6e628223e925998f1e /crates/completion/src/render.rs
parent93bc009a5968c964693299263689b50b2efe9abc (diff)
Use stateless completion resolve
Diffstat (limited to 'crates/completion/src/render.rs')
-rw-r--r--crates/completion/src/render.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/crates/completion/src/render.rs b/crates/completion/src/render.rs
index a6faedb18..9a43480e1 100644
--- a/crates/completion/src/render.rs
+++ b/crates/completion/src/render.rs
@@ -9,8 +9,7 @@ pub(crate) mod type_alias;
9 9
10mod builder_ext; 10mod builder_ext;
11 11
12use hir::{Documentation, HasAttrs, HirDisplay, ModPath, Mutability, ScopeDef, Type}; 12use hir::{Documentation, HasAttrs, HirDisplay, Mutability, ScopeDef, Type};
13use ide_db::helpers::insert_use::{ImportScope, MergeBehaviour};
14use ide_db::RootDatabase; 13use ide_db::RootDatabase;
15use syntax::TextRange; 14use syntax::TextRange;
16use test_utils::mark; 15use test_utils::mark;
@@ -48,15 +47,12 @@ pub(crate) fn render_resolution<'a>(
48 47
49pub(crate) fn render_resolution_with_import<'a>( 48pub(crate) fn render_resolution_with_import<'a>(
50 ctx: RenderContext<'a>, 49 ctx: RenderContext<'a>,
51 import_path: ModPath, 50 import_edit: ImportEdit,
52 import_scope: ImportScope,
53 merge_behaviour: Option<MergeBehaviour>,
54 resolution: &ScopeDef, 51 resolution: &ScopeDef,
55) -> Option<CompletionItem> { 52) -> Option<CompletionItem> {
56 let local_name = import_path.segments.last()?.to_string();
57 Render::new(ctx).render_resolution( 53 Render::new(ctx).render_resolution(
58 local_name, 54 import_edit.import_path.segments.last()?.to_string(),
59 Some(ImportEdit { import_path, import_scope, merge_behaviour }), 55 Some(import_edit),
60 resolution, 56 resolution,
61 ) 57 )
62} 58}