mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Simplify
This commit is contained in:
parent
d7374ab882
commit
2e733b1a3e
5 changed files with 70 additions and 58 deletions
|
@ -5,8 +5,10 @@ use ide_db::helpers::SnippetCap;
|
|||
use itertools::Itertools;
|
||||
|
||||
use crate::{
|
||||
context::ParamKind, item::CompletionKind, render::RenderContext, CompletionItem,
|
||||
CompletionItemKind,
|
||||
context::{ParamKind, PatternContext},
|
||||
item::CompletionKind,
|
||||
render::RenderContext,
|
||||
CompletionItem, CompletionItemKind,
|
||||
};
|
||||
|
||||
pub(crate) fn render_struct_pat(
|
||||
|
@ -86,7 +88,10 @@ fn render_pat(
|
|||
_ => return None,
|
||||
};
|
||||
|
||||
if ctx.completion.is_param == Some(ParamKind::Function) {
|
||||
if matches!(
|
||||
ctx.completion.pattern_ctx,
|
||||
Some(PatternContext { is_param: Some(ParamKind::Function), .. })
|
||||
) {
|
||||
pat.push(':');
|
||||
pat.push(' ');
|
||||
pat.push_str(name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue