Skip to content

pointer typed decl literals have no hover #2498

@leecannon

Description

@leecannon

Zig Version

0.16.0-dev.728+87c18945c

ZLS Version

0.16.0-dev.26+8b2754ad

Client / Code Editor / Extensions

vscode

Steps to Reproduce and Observed Behavior

When a decl literal is a pointer type there is no hover or goto definition supported on it.

const Struct = struct {
    field: bool = false,

    fn valueFn() Struct {
        return .{};
    }

    fn pointerFn() *const Struct {
        return &value;
    }

    const value: Struct = .{};
    const ptr: *const Struct = &value;
};

pub fn main() !void {
    // hover and goto definition work
    const a: Struct = .valueFn();
    const b: Struct = .value;

    // no hover or goto definition
    const c: *const Struct = .pointerFn();
    const d: *const Struct = .ptr;

    _ = a;
    _ = b;
    _ = c;
    _ = d;
}

Expected Behavior

Hover and goto definition work on decl literals returning pointers.

Log Output

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