Skip to content

Introduce a LineSuffix Doc #65

@JohnnyMorganz

Description

@JohnnyMorganz

I'm currently thinking about using pretty.rs for one of my projects, but one thing holding me back is that I can't seem to find a nice way to handle comments currently. Trailing comments can be quite a pain, and you don't want them to be introduced in between code, rather pushed towards the end of the line and then printed there.

From what I can see, there isn't a simple way to do this (please let me know if I'm missing something!). Prettier implements a lineSuffix and lineSuffixBoundary Doc, which places the Doc into a buffer and then outputs it just before a new line - which would immediately help with this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions