简体   繁体   English

IntelliJ IDEA Scala - 重新格式化文件:将案例类放在开头

[英]IntelliJ IDEA Scala - reformat file: put case classes at the beginning

I'm using the shortcut to reformat file my.scala files.我正在使用快捷方式reformat file my.scala 文件。 After that, the types are at the beginning, then come functions and the case class at the bottom.之后, types在开头,然后是functions和底部的case class

I would like to change the order when formatting to have types , case classes and then functions .我想在格式化时更改顺序以具有typescase classesfunctions

I cannot find where should I set this, any ideas?我找不到我应该在哪里设置这个,有什么想法吗?

PS: IntelliJ IDEA Community 2019.2 PS:IntelliJ IDEA 社区 2019.2

You can change the arrangement rules when formatting from here: Settings/Preferences | Editor | Code Style | Scala您可以从此处格式化时更改排列规则: Settings/Preferences | Editor | Code Style | Scala Settings/Preferences | Editor | Code Style | Scala Settings/Preferences | Editor | Code Style | Scala and then go to the Arrangement tab. Settings/Preferences | Editor | Code Style | Scala然后 go 到Arrangement选项卡。

If you don't see Scala as a language you have to install Scalafmt plugin.如果你没有看到 Scala 作为一种语言,你必须安装Scalafmt插件。

The official documentation from Intellij is here . Intellij 的官方文档在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM