Skip to content

[Bug]: Comments in otherwise empty object pattern disappear when formatting #1804

@Meowtimer

Description

@Meowtimer

Description

When formatting code with object patterns containing comments (probably property expressions commented out for debugging or some such) which are otherwise empty the formatter produces a completely empty object pattern without the comments.

Steps to Reproduce

Format code with comments in object pattern.

var match = obj is {
    //Property: 123
};

=>

var match = obj is { };

Expected Behavior

Comments left intact.

Actual Behavior

Comments removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions