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

Rewrite dotty to indent after #17522 #17618

Closed
wants to merge 5 commits into from
Closed

Commits on May 30, 2023

  1. Configuration menu
    Copy the full SHA
    d5a7131 View commit details
    Browse the repository at this point in the history
  2. Patch indentation with -indent -rewrite

    Ensure indentation is correct when removing braces.
    
    If the first indentation of the region is greater than the indentation
    of the enclosing region, we use it to indent the whole region.
    Otherwise we use the incremented indentation of the enclosing region.
    
    ```scala
      def foo = {
            x // we replicate indentation of x downward in region
        y
      }
    ```
    
    ```scala
      def foo = {
    x // indentation of x is incorrect, we increment enclosing indentation
      y
      }
    ```
    
    A bigger indentation than the required one is permitted except
    just after a closing brace.
    
    ```scala
    def bar = {
      x
        .toString // permitted indentation
      def foo = {
      }
        bar //  must be unindented, to not fall into the body of foo
    }
    ```
    adpi2 committed May 30, 2023
    Configuration menu
    Copy the full SHA
    b949156 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4b74746 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    25f6977 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e674eaa View commit details
    Browse the repository at this point in the history