Trigger call info for more completions of signature having things

This commit is contained in:
Lukas Wirth 2023-02-14 15:11:40 +01:00
parent 95fa278f30
commit cade9f7020
3 changed files with 8 additions and 2 deletions

View File

@ -587,6 +587,7 @@ fn main() { Foo::Fo$0 }
),
lookup: "Foo{}",
detail: "Foo { x: i32, y: i32 }",
trigger_call_info: true,
},
]
"#]],
@ -614,6 +615,7 @@ fn main() { Foo::Fo$0 }
),
lookup: "Foo()",
detail: "Foo(i32, i32)",
trigger_call_info: true,
},
]
"#]],
@ -679,6 +681,7 @@ fn main() { Foo::Fo$0 }
Variant,
),
detail: "Foo",
trigger_call_info: true,
},
]
"#]],
@ -745,6 +748,7 @@ fn main() { let _: m::Spam = S$0 }
postfix_match: None,
is_definite: false,
},
trigger_call_info: true,
},
CompletionItem {
label: "m::Spam::Foo",
@ -770,6 +774,7 @@ fn main() { let _: m::Spam = S$0 }
postfix_match: None,
is_definite: false,
},
trigger_call_info: true,
},
]
"#]],
@ -942,6 +947,7 @@ enum E {
documentation: Documentation(
"variant docs",
),
trigger_call_info: true,
},
CompletionItem {
label: "E",

View File

@ -113,7 +113,7 @@ fn render(
item.detail(rendered.detail);
match snippet_cap {
Some(snippet_cap) => item.insert_snippet(snippet_cap, rendered.literal),
Some(snippet_cap) => item.insert_snippet(snippet_cap, rendered.literal).trigger_call_info(),
None => item.insert_text(rendered.literal),
};

View File

@ -72,7 +72,7 @@ pub(crate) fn render_union_literal(
.set_relevance(ctx.completion_relevance());
match ctx.snippet_cap() {
Some(snippet_cap) => item.insert_snippet(snippet_cap, literal),
Some(snippet_cap) => item.insert_snippet(snippet_cap, literal).trigger_call_info(),
None => item.insert_text(literal),
};