Skip to content

completions for anonymous struct parameters only happen if the struct type and function are defined in a different file #1617

Closed
@xdBronch

Description

@xdBronch

Zig Version

0.12.0-dev.1680+be6f76655

Zig Language Server Version

0.12.0-dev.248+62f17ab

Steps to Reproduce

// main.zig
pub fn main() void {
    foo(.{<cursor>});
}

const Config = struct {
    conf: void,
};

fn foo(_: Config) void {}

request completions, none appear. move Config and foo into a separate file

// import.zig
pub const Config = struct {
    conf: void,
};

pub fn foo(_: Config) void {}
/////////////////////////////
// main.zig
const import = @import("import.zig");

pub fn main() void {
    import.foo(.{<cursor>});
}

request completions and they correctly appear

Expected Behavior

completions should always be given

Actual Behavior

inconsistent

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