zls
                                
                                 zls copied to clipboard
                                
                                    zls copied to clipboard
                            
                            
                            
                        Struct initialization completions broken for struct defined in nested struct
Zig Version
0.12.0-dev.899+027aabf49
Zig Language Server Version
1a282b30cccb6dd52438fa1ef6e6b887069e109f
Steps to Reproduce
- 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;
}
- No completions for a
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
Notes:
- Known (parser) limitation.
- Workaround: Do digitdotas if this is a float number, eg1.
This appears to be fixed by https://github.com/zigtools/zls/pull/1536.