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

Writer fixes #1469

Merged
merged 3 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,16 @@ fun RustWriter.containerDocs(text: String, vararg args: Any): RustWriter {
* - Empty newlines are removed
*/
fun <T : AbstractCodeWriter<T>> T.docs(text: String, vararg args: Any, newlinePrefix: String = "/// "): T {
// Because writing docs relies on the newline prefix, ensure that there was a new line written
// before we write the docs
this.ensureNewline()
pushState()
setNewlinePrefix(newlinePrefix)
val cleaned = text.lines()
.joinToString("\n") {
// Rustdoc warns on tabs in documentation
it.trimStart().replace("\t", " ")
}
// Because writing docs relies on the newline prefix, ensure that there was a new line written
// before we write the docs
this.ensureNewline()
write(cleaned, *args)
popState()
return this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ class FluentClientGenerator(
Fluent builders are created through the [`Client`](crate::client::Client) by calling
one if its operation methods. After parameters are set using the builder methods,
the `send` method can be called to initiate the request.
""",
""".trim(),
newlinePrefix = "//! "
)
operations.forEach { operation ->
Expand Down