bytecodealliance / wit-bindgen

A language binding generator for WebAssembly interface types
Apache License 2.0
1.03k stars 194 forks source link

prettyplease strips comments #1086

Open sunfishcode opened 3 hours ago

sunfishcode commented 3 hours ago

As of https://github.com/bytecodealliance/wit-bindgen/pull/971 which switches wit-bindgen's Rust bindings to use prettyplease, the "DO NOT EDIT" and "Options used:" comments no longer appear in the generated output. For example, in the hello-wasi-http example, the diff looks like this:

--- a/src/bindings.rs
+++ b/src/bindings.rs
@@ -1,5 +1,3 @@
-// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT!
-// Options used:
 #[allow(dead_code)]
 pub mod wasi {
     #[allow(dead_code)]

I debugged this and found that the comments are getting stripped here where prettyplease is invoked.

@yoshuawuyts

morenol commented 3 hours ago

Related to this https://github.com/dtolnay/prettyplease/issues/50