You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the first shape definition in a smithy file has a documentation comment attached, that comment gets detached from it if there are any imports above.
Actual behavior
Formatting the following example smithy definition:
$version: "2"namespacesmithy.exampleusea.b#c/// This is documentation about a shape.stringMyString
gives:
$version: "2"namespacesmithy.exampleusea.b#c/// This is documentation about a shape.stringMyString
Expected behavior
I would expect the documentation comment to be still attached to the structure that it was defined for.
$version: "2"namespacesmithy.exampleusea.b#c/// This is documentation about a shape.stringMyString
Hey, thanks for the detailed issue. This should be easy to fix.
With that said, the smithy-cli officially has support for formatting and should be the good to in the future. We're aware that most people that use our formatter do it because it comes bundled in the smithy-language-server (so indirectly files are formatted within the IDE) and that's why we try to keep the lights on here.
Before spending time on this, I decided to look at the LSP and see if we could use the official formatter (which handles this case correctly) and turns out it was a relatively easy swap, so I opened a PR there. I'll wait for feedback there before proceeding with a fix here. The reason is that even if I fix it here, we still have to bump the version in the LSP after that so your IDE gets formatting correctly.
Instead, the PR referenced above removes the middleman and just uses the official formatter, so it removes the middleman and fix the issue.
Problem description
If the first shape definition in a smithy file has a documentation comment attached, that comment gets detached from it if there are any imports above.
Actual behavior
Formatting the following example smithy definition:
gives:
Expected behavior
I would expect the documentation comment to be still attached to the structure that it was defined for.
tested on 8111fdd
The text was updated successfully, but these errors were encountered: