Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New primitive to fill a line with as many doc parts as possible #1120

Merged
merged 14 commits into from May 10, 2017

Commits on May 7, 2017

  1. Add new fill primitive and use it to wrap text in JSX

    This adds a new `fill` primitive that can be used to fill lines with as much code as possible before moving to a new line with the same indentation.
    
    It is used here layout JSX children. This gives us nicer wrapping for JSX elements containings lots of text interspersed with tags.
    karl committed May 7, 2017
    Configuration menu
    Copy the full SHA
    5595d7a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8f12bbd View commit details
    Browse the repository at this point in the history
  3. Fix a couple more bugs

    karl committed May 7, 2017
    Configuration menu
    Copy the full SHA
    db0a639 View commit details
    Browse the repository at this point in the history
  4. Tidy up the fill algorithm

    Attempt to make the algorithm a little more regular, and improve the naming of variables to make it a little easier to understand (I hope!).
    karl committed May 7, 2017
    Configuration menu
    Copy the full SHA
    fe54811 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    12e1716 View commit details
    Browse the repository at this point in the history
  6. Remove unnecessary code

    It turns out that `children` is only used in the case when the element is printed on a single line, in which case all the types of JSX whitespaces behave the same, so we don't need to special case leading/trailing/solitary whitespace.
    karl committed May 7, 2017
    Configuration menu
    Copy the full SHA
    dba1a72 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5496bde View commit details
    Browse the repository at this point in the history
  8. Fix up tests after rebasing

    karl committed May 7, 2017
    Configuration menu
    Copy the full SHA
    4fd4444 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1858d5e View commit details
    Browse the repository at this point in the history
  10. Add an explanatory comment

    karl committed May 7, 2017
    Configuration menu
    Copy the full SHA
    9884b3a View commit details
    Browse the repository at this point in the history
  11. Fix broken snapshot in master

    karl committed May 7, 2017
    Configuration menu
    Copy the full SHA
    50908f6 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    4b4e365 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    83397ec View commit details
    Browse the repository at this point in the history
  14. Tidy up JSX whitespace names

    karl committed May 7, 2017
    Configuration menu
    Copy the full SHA
    b84438e View commit details
    Browse the repository at this point in the history