Skip to content

Add rustfmt.toml #569

Open
Open

Description

@rchaser53

I want to add the rustfmt.toml to rust-playground. The motivation is below.

  • to report the rustfmt bug with option easily
  • to create the working example for rustfmt option

I think this issue helps us to resolve the issue easily and a convenience to know the behavior about rustfmt option. If you don't mind, can I create this feature?

Activity

  1. added
    enhancement
    on Jan 22, 2020
  2. changed the title [-]add the rustfmt.toml in rust-playground[/-] [+]Add rustfmt.toml[/+] on Jan 22, 2020
  3. shepmaster commented on Jan 22, 2020

    @shepmaster
    Member

    It's not clear what you mean by this. Can you please provide a more detailed plan of what exactly the feature will do, a rough guide of how the feature will be implemented, and a general idea of what the UI will look like?

  4. rchaser53 commented on Jan 23, 2020

    @rchaser53
    ContributorAuthor

    I think there is two-step to introduce this feature, so I plan to send the PR two times at least.

    1. add the modal to write rustfmt.toml. the content in modal is sent to the server and mounted on docker container as rustfmt.toml. (I plan to implement like main.rs in rust-playground.)
    2. includes the rustfmt.toml information in a permanent link

    I already confirmed the rustfmt.toml mounted to docker worked on rust-playground.
    The UI image is below. The dialog design is not decided. I think it will be changed.

    new_feature_image

  5. rchaser53 commented on Jan 23, 2020

    @rchaser53
    ContributorAuthor

    I think this modal approach is useful when a new config file will be added. Easy for extensible.
    (ex. clippy.toml)

  6. shepmaster commented on Jan 24, 2020

    @shepmaster
    Member

    Thank you for the screenshots and clarifications!

    I wonder if adding the element to open the configuration next to the rustfmt button would make more sense and be more discoverable.

    One thing I can see people wanting is some kind of autocomplete for the config file. An easier middle ground would be a link to the rustfmt doc page.

    I'm not extremely excited for modals, but that could be a reasonable place to start.

  7. rchaser53 commented on Jan 24, 2020

    @rchaser53
    ContributorAuthor

    I wonder if adding the element to open the configuration next to the rustfmt button would make more sense and be more discoverable.

    I think so too. I will add the config button next rustfmt button.

    One thing I can see people wanting is some kind of autocomplete for the config file. An easier middle ground would be a link to the rustfmt doc page.
    I'm not extremely excited for modals, but that could be a reasonable place to start.

    I also think some kind of autocomplete for the config file is better than a simple modal. But rustfmt options exist over 50 now and are expected to continue to increase(This number includes unstable options). It's a bit hard to add autocomplete soon. So the modal is a reasonable place to start. And as you say I need to add the rustfmt help page link.

    Based on the above I attached the redesigned image. The help link is a GitHub page for rustfmt. https://rust-lang.github.io/rustfmt/

    version2

  8. rchaser53 commented on Jan 24, 2020

    @rchaser53
    ContributorAuthor

    If there is not a big problem, I want to start creating PR.
    How about arguing the detail UI design after when I send the PR?

  9. rchaser53 commented on Jan 27, 2020

    @rchaser53
    ContributorAuthor

    The more detail. I think the right side of the modal can be used for autocomplete UI(not implemented now) in the feature. The ? icon is a link for the rustfmt GitHub page.
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions