Skip to content

Struct initialization completions broken for struct defined in nested struct #1525

Open
@Jarred-Sumner

Description

@Jarred-Sumner

Zig Version

0.12.0-dev.899+027aabf49

Zig Language Server Version

1a282b3

Steps to Reproduce

  1. Paste the following code:
pub const bar = struct {
    pub const baz = struct {
        pub const Foo = struct {
            a: u32 = 0,
        };

        pub fn qux() u32 {
            return Foo{
                .
            };
        }
    };
};
test {
    bar.baz.qux() == 0;
}
  1. No completions for a
image

Note that if Foo is moved to be defined inside bar instead of baz, it works as expected.

Expected Behavior

Completions for the Foo struct fields should work

Actual Behavior

No completions for the struct fields

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions