Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Jarred-Sumner opened this issue Oct 15, 2023 · 2 comments · May be fixed by #1536
Open

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

Jarred-Sumner opened this issue Oct 15, 2023 · 2 comments · May be fixed by #1536
Labels
bug Something isn't working

Comments

@Jarred-Sumner
Copy link
Contributor

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

@Jarred-Sumner Jarred-Sumner added the bug Something isn't working label Oct 15, 2023
@llogick
Copy link
Contributor

llogick commented Oct 15, 2023

Notes:

  • Known (parser) limitation.
  • Workaround: Do digit dot as if this is a float number, eg 1.

@Techatrix
Copy link
Member

This appears to be fixed by #1536.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants