mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-22 20:53:37 +00:00
Revert omitting field completions
This commit is contained in:
parent
c1f6f135e1
commit
a40a847d77
@ -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(
|
||||
|
@ -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(),
|
||||
|
@ -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
|
||||
"#]],
|
||||
|
Loading…
Reference in New Issue
Block a user