zls
zls copied to clipboard
Go To Declaration fails with aliasing
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
are you sure youre using goto declaration and not goto definition? this is working as expected for me
Yes. The behavior is the same for go to definition and go to declaration with the baz case. Perhaps this has been fixed in a more recent version.