scalafmt overly / eagerly formatting

Answered

I'm using Scala 3.1.2, sbt 1.6.2 and scalafmt 3.5.8 and IntelliJ 2022.2 EAP. THE ISSUE: Using .scalafmt since some days (don't recall the exacat update) it has started to overly format and remove white spaces on the fly as I type regardless if typed content is in comments or in actual code. Also it has basically disabled code completion by Tab. I did try to use // format:off, but only workaround was to disable scalafmt and use only IntelliJ IDE. Since scalafmt saves a ton of time as I'm used to it, I was wandering if there is any awareness of this behavior? 

13 comments
Comment actions Permalink

Could you provide a code sample where this can be reproduced?

What formatter is selected in the Preferences| Editor | Code Style | Scala dialog, IntelliJ or Scalafmt?

0
Comment actions Permalink

I have Scalafmt selected as formatter, which worked fine till maybe a week ago or so. This is a nightmare and if I try to use ScalaDocs type of comments, it is not possible if scalafmt is on, because it does not allow adding lines (mening that if I press Enter for a new line it removes the line immediately after I pressed the Enter). This is a burden even with smallest pieces of code, such as:

package threeProto.importToDB

object NgenImport:

/** ==Engage file import processes== */
def beginImport(): Unit =
println("import engaged")

// def readFromFile
0
Comment actions Permalink

In addition IDE is now just raining errors and occasionally gets totally stuck. Getting close to a point to get rid of whole EAP mess...

0
Comment actions Permalink

Rolled back to 2022.1.2 and life is good :)

 

0
Comment actions Permalink

Thanks for the info.

Would it be possible for you to also provide the idea.log file of the 2022.2 EAP version? The log directory can be found here. You can upload it securely to https://uploads.jetbrains.com/ and provide the upload id.

0
Comment actions Permalink

Hi, Sent as instructed. Did you get it?

0
Comment actions Permalink

Please provide the upload id, then I will be able to identify it among other uploads.

0
Comment actions Permalink

Upload ID: 2022_06_09_xHFkNCu1eFgfArJ14ZEZit (files: .pid and 19 more)

0
Comment actions Permalink

Thanks, but this looks like the contents of the %LOCALAPPDATA%\JetBrains\IntelliJIdea2022.2 directory. If you could go one level deeper from there, into the ...\log directory, and find the file called idea.log there, that would be the file that I need.

0
Comment actions Permalink

Upload ID: 2022_06_09_Dtf6rwUjreoSgmaZMJ43af (file: idea.log)

0
Comment actions Permalink

Thank you! 

I created a corresponding bug report in our system for it: https://youtrack.jetbrains.com/issue/SCL-20302

Responsible developers will look into it shortly.

Feel free to follow the ticket to get updates on the progress of the investigation.

0
Comment actions Permalink

Sure, thanks!

0
Comment actions Permalink

Arina Efremova thanks for your reaction, got a positive message confirming the fix will be in a future EAP.

1

Please sign in to leave a comment.