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

Add newline instead of space if contructor is followed by a literal #2713

Closed
wants to merge 1 commit into from

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Aug 30, 2021

Fixes #2712

class Toto() {
private def myScalaFmtTest(): String = {
val test = new Toto
("test")
Copy link
Collaborator

Choose a reason for hiding this comment

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

i suspect the problem here might be a little different. if you prepend ONLY to the test title, it will print both formatting details, and the rules invoked should be the same.

perhaps because of redundant paren rewrite, the statement start logic missed this case? can you add another test where the expression in parens doesn't start with a literal? a method call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ach, you are right, it's redundant paren rewrite. Do we update statement starts with that rule?

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.

Formatting issue with scalafmt 3.0.1
2 participants