mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
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 hir::db::HirDatabase;
|
||||||
|
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
|
|
||||||
pub fn get_missing_impl_items(
|
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()))
|
.map(|n| !impl_fns_consts.contains(&n.to_string()))
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
})
|
})
|
||||||
.map(|i| i.clone())
|
.cloned()
|
||||||
.collect()
|
.collect()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
use crate::completion::{
|
//! FIXME: write short doc here
|
||||||
CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, Completions,
|
|
||||||
|
use crate::{
|
||||||
|
completion::{CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, Completions},
|
||||||
|
display::FunctionSignature,
|
||||||
};
|
};
|
||||||
|
|
||||||
use hir::{self, Docs, HasSource};
|
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) {
|
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 display = FunctionSignature::from_hir(ctx.db, func.clone());
|
||||||
|
|
||||||
let func_name = func.name(ctx.db);
|
let func_name = func.name(ctx.db);
|
||||||
|
@ -51,11 +52,7 @@ fn add_function_impl(acc: &mut Completions, ctx: &CompletionContext, func: &hir:
|
||||||
CompletionItemKind::Function
|
CompletionItemKind::Function
|
||||||
};
|
};
|
||||||
|
|
||||||
let snippet = {
|
let snippet = format!("{} {{}}", display);
|
||||||
let mut s = format!("{}", display);
|
|
||||||
s.push_str(" {}");
|
|
||||||
s
|
|
||||||
};
|
|
||||||
|
|
||||||
builder.insert_text(snippet).kind(completion_kind).add_to(acc);
|
builder.insert_text(snippet).kind(completion_kind).add_to(acc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue