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

Show type of variables on introspection #469

Closed
leighmcculloch opened this issue Mar 7, 2022 · 2 comments · Fixed by #513
Closed

Show type of variables on introspection #469

leighmcculloch opened this issue Mar 7, 2022 · 2 comments · Fixed by #513

Comments

@leighmcculloch
Copy link

I've noticed that zls in vscode doesn't display the type when showing more information about a variable. Instead it shows the definition.

Here's an example of what I'm seeing with zls:
zig-language-server

Compared to the information typically shown in other langs (e.g. Go):
go-language-server

According to the lovely folks in Discord (discussion) this is by design and not a bug, but something that could be improved.

The value in improving this is largely driven by the fact that in Zig the types of values are not always found at the location of the declaration. This isn't unique of Zig, plenty of other languages allow for this. ZLS could help provide this introspection that the source itself does not make clear.

@SuperAuguste
Copy link
Member

Hey Leigh, thanks for opening an issue! This is an awesome idea and the only problem I can see with this is types determined by some sort of comptime logic. Does anybody want to tackle this one? Else I can try and spin something up! :)

@SuperAuguste
Copy link
Member

Ok so I lied about the call for PRs, I'm tackling this right now :)

Thoughts on this look?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants