Revert omitting field completions

This commit is contained in:
Lukas Wirth 2022-03-16 16:41:35 +01:00
parent c1f6f135e1
commit a40a847d77
3 changed files with 2 additions and 11 deletions

View File

@ -319,9 +319,7 @@ impl Completions {
variant,
local_name.clone(),
None,
false,
));
self.add_opt(render_variant_pat(RenderContext::new(ctx), variant, local_name, None, true));
}
pub(crate) fn add_qualified_variant_pat(
@ -331,8 +329,7 @@ impl Completions {
path: hir::ModPath,
) {
let path = Some(&path);
self.add_opt(render_variant_pat(RenderContext::new(ctx), variant, None, path, false));
self.add_opt(render_variant_pat(RenderContext::new(ctx), variant, None, path, true));
self.add_opt(render_variant_pat(RenderContext::new(ctx), variant, None, path));
}
pub(crate) fn add_struct_pat(

View File

@ -37,16 +37,11 @@ pub(crate) fn render_variant_pat(
variant: hir::Variant,
local_name: Option<Name>,
path: Option<&hir::ModPath>,
omit_fields: bool,
) -> Option<CompletionItem> {
let _p = profile::span("render_variant_pat");
let fields = variant.fields(ctx.db());
let (visible_fields, fields_omitted) = if omit_fields {
(Vec::new(), false)
} else {
visible_fields(ctx.completion, &fields, variant)?
};
let (visible_fields, fields_omitted) = visible_fields(ctx.completion, &fields, variant)?;
let name = match path {
Some(path) => path.to_string().into(),

View File

@ -124,7 +124,6 @@ fn foo() {
st Unit
ma makro!() macro_rules! makro
bn TupleV TupleV($1)$0
bn TupleV TupleV()$0
ev TupleV
ct CONST
"#]],