Fixing minor suggestions and added module level documentation.
This commit is contained in:
parent
e664cd73e3
commit
47d314e856
2 changed files with 7 additions and 11 deletions
|
@ -6,7 +6,6 @@ use ra_syntax::{
|
|||
};
|
||||
|
||||
use hir::db::HirDatabase;
|
||||
|
||||
use rustc_hash::FxHashSet;
|
||||
|
||||
pub fn get_missing_impl_items(
|
||||
|
@ -55,7 +54,7 @@ pub fn get_missing_impl_items(
|
|||
.map(|n| !impl_fns_consts.contains(&n.to_string()))
|
||||
.unwrap_or_default(),
|
||||
})
|
||||
.map(|i| i.clone())
|
||||
.cloned()
|
||||
.collect()
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
use crate::completion::{
|
||||
CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, Completions,
|
||||
//! FIXME: write short doc here
|
||||
|
||||
use crate::{
|
||||
completion::{CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, Completions},
|
||||
display::FunctionSignature,
|
||||
};
|
||||
|
||||
use hir::{self, Docs, HasSource};
|
||||
|
@ -29,8 +32,6 @@ pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext
|
|||
}
|
||||
|
||||
fn add_function_impl(acc: &mut Completions, 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);
|
||||
|
@ -51,11 +52,7 @@ fn add_function_impl(acc: &mut Completions, ctx: &CompletionContext, func: &hir:
|
|||
CompletionItemKind::Function
|
||||
};
|
||||
|
||||
let snippet = {
|
||||
let mut s = format!("{}", display);
|
||||
s.push_str(" {}");
|
||||
s
|
||||
};
|
||||
let snippet = format!("{} {{}}", display);
|
||||
|
||||
builder.insert_text(snippet).kind(completion_kind).add_to(acc);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue