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

Router: don't add extra indent for fewer braces #3518

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

kitbellew
Copy link
Collaborator

@kitbellew kitbellew commented Mar 24, 2023

And don't indent select after them, as that's not yet supported by the compiler. Fixes #3489.

@kitbellew
Copy link
Collaborator Author

Depends on #3514.

@kitbellew kitbellew requested a review from tgodzik March 24, 2023 21:28
indent.fewerBraces
```

> In Scala 3.3.0-RC3, only `never` provides compiler-compatible code.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we introduce a setting based on something that might be fixed? I would hold off in that case

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

could you explain it, please? if this is fixed in the compiler, some people might still prefer different options. and if it's not, then the current implementation doesn't work.

by the way, are you and Martin close to an agreement on that fix? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

only never provides compiler-compatible code.

That's what worries me, if user sets something wrong it breaks their compilation, no?

by the way, are you and Martin close to an agreement on that fix? :)

I need to come back to it, don't remember what's the current status :O

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

only never provides compiler-compatible code.

That's what worries me, if user sets something wrong it breaks their compilation, no?

so what's the solution, then? right now, it will always break their compilation...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the only other suggestion i might have is

  • add a new dialect field in scalameta to say select can be indented after fewer braces
  • set that flag in scala33
  • add a new intermediate scala330rc2 dialect where this flag is not set
  • move fewer braces to that dialect as well, as it hadn't been available before that.

Copy link
Contributor

Choose a reason for hiding this comment

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

so what's the solution, then? right now, it will always break their compilation...

Couldn't we make never the default without the new setting for now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

so what's the solution, then? right now, it will always break their compilation...

Couldn't we make never the default without the new setting for now?

done

@kitbellew kitbellew changed the title Indents: add parameter to indent fewer braces Router: don't add extra indent for fewer braces Mar 28, 2023
And don't indent select after them, as that's not yet supported by the
compiler.
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.

Thanks!

@kitbellew kitbellew merged commit a56d056 into scalameta:master Mar 28, 2023
@kitbellew kitbellew deleted the 3489 branch March 28, 2023 17:22
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.

Inconsistent fewerBraces indentation
2 participants