Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go To Declaration fails with aliasing #2054

Open
William65536 opened this issue Oct 17, 2024 · 2 comments
Open

Go To Declaration fails with aliasing #2054

William65536 opened this issue Oct 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@William65536
Copy link

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

@William65536 William65536 added the bug Something isn't working label Oct 17, 2024
@xdBronch
Copy link
Contributor

are you sure youre using goto declaration and not goto definition? this is working as expected for me

@William65536
Copy link
Author

William65536 commented Oct 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants