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

Patch indentation when removing braces (and other bug fixes in -indent -rewrite) #17522

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

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

Commits on Jun 13, 2023

  1. Patch indentation when removing braces (essentials)

    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
    }
    ```
    
    And other bug fixes (see lampepfl#17522)
    adpi2 committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    c6afb38 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    de08ae0 View commit details
    Browse the repository at this point in the history
  3. Add indent rewrite tests

    adpi2 committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    5657b69 View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2023

  1. Fix end ident followed by MATCH

    adpi2 committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    351b5f5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a0d28a3 View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2023

  1. Introduce ToIndentParser and ToIndentScanner

    Remove ScriptParsers
    adpi2 committed Jul 5, 2023
    Configuration menu
    Copy the full SHA
    d30ab4d View commit details
    Browse the repository at this point in the history
  2. Silence initialization checker

    adpi2 committed Jul 5, 2023
    Configuration menu
    Copy the full SHA
    de76335 View commit details
    Browse the repository at this point in the history
  3. Fix indent-comments test

    We cannot remove braces after a new line,
    to prevent from removing braces in stat seq.
    adpi2 committed Jul 5, 2023
    Configuration menu
    Copy the full SHA
    f4b91e3 View commit details
    Browse the repository at this point in the history