From fc46ed81ee54d342d83e428ca74cbb0083547251 Mon Sep 17 00:00:00 2001 From: Kevin DeLorey <2295721+kdelorey@users.noreply.github.com> Date: Tue, 4 Feb 2020 22:04:57 -0600 Subject: Add detection for a user already starting a fn impl and still providing completion. --- crates/ra_ide/src/completion/presentation.rs | 33 ---------------------------- 1 file changed, 33 deletions(-) (limited to 'crates/ra_ide/src/completion/presentation.rs') diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs index 0689013ba..97475fc0b 100644 --- a/crates/ra_ide/src/completion/presentation.rs +++ b/crates/ra_ide/src/completion/presentation.rs @@ -129,39 +129,6 @@ impl Completions { self.add_function_with_name(ctx, None, func) } - pub(crate) fn add_function_impl(&mut self, ctx: &CompletionContext, func: &hir::Function) { - use crate::display::FunctionSignature; - - let display = FunctionSignature::from_hir(ctx.db, func.clone()); - - let func_name = func.name(ctx.db); - - let mut builder = CompletionItem::new( - CompletionKind::Reference, - ctx.source_range(), - format!("fn {}()", func_name.to_string())) - .set_documentation(func.docs(ctx.db)); - - let completion_kind = if func.has_self_param(ctx.db) { - CompletionItemKind::Method - } else { - CompletionItemKind::Function - }; - - let snippet = { - let mut s = format!("{}", display); - s.push_str(" { $0}"); - s - }; - - builder = builder - .insert_text(snippet) - .kind(completion_kind) - .lookup_by(func_name.to_string()); - - self.add(builder.build()); - } - fn guess_macro_braces(&self, macro_name: &str, docs: &str) -> &'static str { let mut votes = [0, 0, 0]; for (idx, s) in docs.match_indices(¯o_name) { -- cgit v1.2.3