-
Notifications
You must be signed in to change notification settings - Fork 82
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
Use triple-slash comments for documentation #286
Comments
That's a good point, languages like claw will definitely want to The best way to enable this is for WIT itself to use the prefix |
Yes, that's a good point. The high-order bit in #273 was removing a confusing choice by having only one form of comment, but this could be achieved just as well by having that form be |
Setting aside churn for a moment, I'm not sure I understand fully how this would enable other languages to use As for the churn, I'd need to better understand the fate of |
The idea is to normalize on Then languages which extend or embed WIT would be able to use the |
Concerning churn, all the Wit files I've seen are currently using |
Ah ok I think I see better now. In that case the "churn" here would be that wit-parser would start to emit a warning to stdio whenever it encountered a That I do think will require some changes to be made but I think it's feasible to do. |
Per the discussion in WebAssembly/component-model#286, switch to `///` for documentation comments in the Wit printer. `//` comments are still accepted and interpreted as documentation comments for now.
* Switch to `///` for printing documentation comments. Per the discussion in WebAssembly/component-model#286, switch to `///` for documentation comments in the Wit printer. `//` comments are still accepted and interpreted as documentation comments for now. * Update to the latest wasi-http. * Update a few more tests to `///` doc comments.
Per the discussion in WebAssembly/component-model#286, remove some `//` comments which had been intended as non-documentation comments to `///` documentation comments.
Per the discussion in WebAssembly/component-model#273, the Wit format is moving to only have documentation comments. A as of WebAssembly/component-model#286, the syntax for documentation commments is `///`. This patch converts a few of the remaining `//` comments in network.wit to `///` comments.
* Switch to `///` comments. Per the discussion in WebAssembly/component-model#286, remove some `//` comments which had been intended as non-documentation comments to `///` documentation comments. * Update to the latest wasi-sockets and wasi-io. Update to the latest wasi-sockets and wasi-io. The only changes are the addition of some comments, and changing some comments from `//` to `///`.
Wit [uses tripe-slash comments] for documentation; update a few example code blocks accordingly. [uses tripe-slash comments]: WebAssembly/component-model#286
I propose that the Wit format use
///
comments, rather than//
.Wit itself no longer has non-documentation comments, however multiple projects are looking at using Wit as a base language that they can extend with more features. For such languages, it will be desirable to be able to have both documentation and regular comments, while remaining a superset of Wit.
Using
///
for documentation and//
for regular comments is a common convention, found in rustdoc, doxygen, C#, Swift, and others.In the short term, the wit tooling can continue to accept both
///
and//
as documentation comments, until existing Wit files are migrated. In the long term, wit tooling could reject//
comments to free up their space in the grammar for derived languages.@peterhuene @lukewagner @esoterra
The text was updated successfully, but these errors were encountered: