Beef
Beef copied to clipboard
Autocomplete suggestions disappear when assigning the top-most member during structure initialization
public struct MyStruct
{
public int field1;
public int field2;
public int field3;
}
// Somewhere else...
MyStruct struct1 = .()
{
// As expected, beginning to type "field" suggests all three member variables for autocomplete.
};
MyStruct struct2 = .()
{
// Same as above. Beginning to type "field" suggests all three member variables for autocomplete.
field2 = 123,
};
// Note that the remaining examples use let notation, with the structure name on the right.
let struct3 = MyStruct()
{
// Same as above. Beginning to type "field" suggests all three member variables for autocomplete.
};
let struct4 = MyStruct()
{
// Here's the bug. When at least one member variables is already assigned during structure initialization AND the
// cursor is placed above the top-most assignment, the IDE does NOT suggest any member variables for autocomplete.
field2 = 123,
};
let struct5 = MyStruct()
{
field2 = 123,
// When typing on this line (NOT above the top-most member assignment), autocomplete correctly suggests member variables.
};
I'm running 10/22/2025. The comments above describe the bug (a failure to suggest member variables for autocompletion), as well as the specific circumstances of the bug's existence. To reiterate, this bug occurs when ALL of the following are true:
- A structure with one or more member variables is being initialized using curly brace syntax. Specifically,
let(orvar) syntax must be used, with the structure name on the right. - At least one assignment already exists within that block.
- The cursor is placed above the top-most assignment within the block.
Also note that under these conditions, autocomplete still appears to work for everything else. In this example (looking at the failure case, struct4), typing field suggests IOnFieldInit, so the autocomplete failure appears specific to member variables of the structure.