Skip to content

Go To Declaration fails with aliasing #2054

@William65536

Description

@William65536

Zig Version

0.14.0-dev.1511+54b668f8a

ZLS Version

0.14.0-dev.147+dd78968

Client / Code Editor / Extensions

VS Code

Steps to Reproduce and Observed Behavior

If you use Go To Declaration on baz ZLS jumps you to foo.

const foo = 0;
const bar = foo;
const baz = bar; // Go To Declaration on baz jumps to `foo`

Expected Behavior

Go To Declaration should respect aliasing and take you to bar instead of foo. This works correctly if you Go To Declaration on bar instead:

const foo = 0;
const bar = foo;
const baz = bar; // Go To Declaration on bar correctly jumps to `const bar = ...`

Relevant log output

No response

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