Smithy is a protocol-agnostic interface definition language and set of tools for generating clients, servers, and documentation for any programming language.
Prior to this commit, we were handling the cases of foo and bar, but inadvertently doing the same thing for baz. This is because we were looking for comments to pull out to above errors in the direct children of OPERATION_ERRORS, which include all WS within the [].
To make it work as expected, we need to only pull out comments in the first two positions (foo, bar), and leave the rest for BracketFormatter to format. BracketFormatter was expecting to operate on all the children of a given TreeCursor, so I modified it to act on an arbitrary stream of cursors, and added a way to get all remaining siblings after a cursor.
Testing
Added a new test case for this
Links
Fixes #2261
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Background
For operation errors like:
you'd expect formatting of:
Prior to this commit, we were handling the cases of
foo
andbar
, but inadvertently doing the same thing forbaz
. This is because we were looking for comments to pull out to aboveerrors
in the direct children of OPERATION_ERRORS, which include all WS within the[]
.To make it work as expected, we need to only pull out comments in the first two positions (
foo
,bar
), and leave the rest for BracketFormatter to format. BracketFormatter was expecting to operate on all the children of a given TreeCursor, so I modified it to act on an arbitrary stream of cursors, and added a way to get all remaining siblings after a cursor.Testing
Links
Fixes #2261
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.