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

Add example code into API hints #378

Open
zhangzhuang15 opened this issue Jan 9, 2025 · 2 comments
Open

Add example code into API hints #378

zhangzhuang15 opened this issue Jan 9, 2025 · 2 comments

Comments

@zhangzhuang15
Copy link

zhangzhuang15 commented Jan 9, 2025

Thanks to your team work, make it easy and delighting to write zig code in vscode. This is not a bug issue, but a feature advice. When I hover on API, such as std.debug.print, it tells me function sign, but it might be better if user can get some example codes from hover hints, like rust-analyzer and Rust document do. I believe that more developers will love Zig, if you team bring this feature.

Screenshot 2025-01-09 at 15 40 53
@Techatrix
Copy link
Collaborator

The documentation on the print function is based on the source code comments that are attached to the given function here. This is not something that this extension can change. Instead, the documentation in the standard library should be updated directly by contributing to Zig itself.

Not to deny your issue but the "Hello World" section in the Zig Language Reference explains how to use the std.debug.print function. I would strongly recommend to read through the language reference.

@zhangzhuang15
Copy link
Author

zhangzhuang15 commented Jan 12, 2025 via email

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

No branches or pull requests

2 participants