-
Notifications
You must be signed in to change notification settings - Fork 196
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
Fixes for RustWriter bugs #1465 & #1459 #1467
Conversation
A new generated diff is ready to view.
A new doc preview is ready to view. |
oh hmm...looking at the generated code diff, this adds extra newlines |
@@ -259,6 +260,9 @@ fun <T : AbstractCodeWriter<T>> T.docs(text: String, vararg args: Any, newlinePr | |||
// 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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking into this from a completely wrong angle..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this!
Motivation and Context
Attribute.Custom.render()
is stripping comment line chars//
#1465Description
Fix for two longstanding RustWriter bugs:
docs
didn't callensureNewLine()
which meant that when it was invoked after a call towriteInline
the leading///
was never written:W
didn't go through template rewriting which meant that it didn't work with case sensitivity.This resolves both of those issues and adds unit tests.
Testing
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.