mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 05:13:35 +00:00
Merge pull request #19363 from euclio/varargs-detail
display varargs in completion detail
This commit is contained in:
commit
8b5816b4f5
3 changed files with 58 additions and 1 deletions
|
|
@ -343,7 +343,7 @@ fn detail_full(ctx: &CompletionContext<'_>, func: hir::Function) -> String {
|
|||
}
|
||||
|
||||
fn params_display(ctx: &CompletionContext<'_>, func: hir::Function) -> String {
|
||||
if let Some(self_param) = func.self_param(ctx.db) {
|
||||
let mut params = if let Some(self_param) = func.self_param(ctx.db) {
|
||||
let assoc_fn_params = func.assoc_fn_params(ctx.db);
|
||||
let params = assoc_fn_params
|
||||
.iter()
|
||||
|
|
@ -360,7 +360,13 @@ fn params_display(ctx: &CompletionContext<'_>, func: hir::Function) -> String {
|
|||
} else {
|
||||
let assoc_fn_params = func.assoc_fn_params(ctx.db);
|
||||
assoc_fn_params.iter().map(|p| p.ty().display(ctx.db, ctx.display_target)).join(", ")
|
||||
};
|
||||
|
||||
if func.is_varargs(ctx.db) {
|
||||
params.push_str(", ...");
|
||||
}
|
||||
|
||||
params
|
||||
}
|
||||
|
||||
fn params(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue