Skip to content

Documentation comments get detached in the presence of imports #226

Open
@ghostbuster91

Description

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:

$version: "2"

namespace smithy.example

use a.b#c

/// This is documentation about a shape.
string MyString

gives:

$version: "2"

namespace smithy.example

use a.b#c
/// This is documentation about a shape.

string MyString

Expected behavior

I would expect the documentation comment to be still attached to the structure that it was defined for.

$version: "2"

namespace smithy.example

use a.b#c

/// This is documentation about a shape.
string MyString

tested on 8111fdd

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions