Simplify
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user