mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
full function signatures option
This commit is contained in:
parent
c405509f2e
commit
23ffda1a97
3 changed files with 10 additions and 2 deletions
|
@ -100,7 +100,7 @@ fn render(
|
|||
|
||||
item.set_documentation(ctx.docs(func))
|
||||
.set_deprecated(ctx.is_deprecated(func) || ctx.is_deprecated_assoc_item(func))
|
||||
.detail(detail(db, func))
|
||||
.detail(detail(db, func, ctx.completion.config.full_function_signatures))
|
||||
.lookup_by(name.unescaped().to_smol_str());
|
||||
|
||||
match ctx.completion.config.snippet_cap {
|
||||
|
@ -239,7 +239,11 @@ fn ref_of_param(ctx: &CompletionContext<'_>, arg: &str, ty: &hir::Type) -> &'sta
|
|||
""
|
||||
}
|
||||
|
||||
fn detail(db: &dyn HirDatabase, func: hir::Function) -> String {
|
||||
fn detail(db: &dyn HirDatabase, func: hir::Function, full_function_signature: bool) -> String {
|
||||
if full_function_signature {
|
||||
return format!("{}", func.display(db)).replace("\n", " ");
|
||||
}
|
||||
|
||||
let mut ret_ty = func.ret_type(db);
|
||||
let mut detail = String::new();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue