zls icon indicating copy to clipboard operation
zls copied to clipboard

Enable completion and goto definition/declaration for a value which type is comptime struct

Open jimying opened this issue 1 year ago • 0 comments

For sample

const builtin = @import("builtin");

pub const DataHdr = if (builtin.cpu.arch.endian() == .big) packed struct {
    v: u2 = 0,
    p: u1 = 0,
    x: u1 = 0,
    cc: u4 = 0,
} else packed struct {
    cc: u4 = 0,
    x: u1 = 0,
    p: u1 = 0,
    v: u2 = 0,
};

test "simple" {
    var hdr: DataHdr = undefined;
    hdr.v = 1;    // For  hdr.v, can't auto complte and goto definition
}

jimying avatar Jan 23 '24 03:01 jimying