Skip to content

Fix #9790: Update indentation spec to match observed behavior #10331

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

Merged
merged 1 commit into from
Nov 16, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Nov 16, 2020

I added the clause

  1. An <outdent> is inserted at a line break, if

    • ...
    • the last token on the previous line is not one of the following tokens
      which indicate that the previous statement continues:
      then  else  do  catch  finally  yield  match
      

I tried to do without the added clause but lots of tests break. To verify, set
Tokens.statCtdTokens to BitSet() and observe the breakage.

I added the clause

 2. An `<outdent>` is inserted at a line break, if

    - ...
    - the last token on the previous line is not one of the following tokens
      which indicate that the previous statement continues:
      ```
      then  else  do  catch  finally  yield  match
      ```

I tried to do without the added clause but lots of tests break. To verify, set
Tokens.statCtdTokens to BitSet() and observe the breakage.
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I will update it in the scalameta parser.

@odersky
Copy link
Contributor Author

odersky commented Nov 16, 2020

@tgodzik Thanks! And sorry for waiting so long to address this... I am still in catchup mode with issues.

@odersky odersky merged commit 94b0d90 into scala:master Nov 16, 2020
@odersky odersky deleted the fix-#9790 branch November 16, 2020 16:55
tgodzik added a commit to tgodzik/scalameta that referenced this pull request Nov 18, 2020
tgodzik added a commit to tgodzik/scalameta that referenced this pull request Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants