Den*_*ash 8 java comments intellij-idea kotlin
我要评论使用时,可以预期Ctrl+/,它的工作原理为Java ,但不是 Kotlin代码,如提及我已经做了帮助台(注:我使用Intellij Ultimate 2018.2)
要在Java中配置注释行为的设置,请使用位于"文件"|"代码生成"选项卡上的"注释代码"部分中的选项 设置/首选项| 编辑| 代码风格| Java的.
标记Add a space at comment start为Commented Code部分,我找不到任何注释代码配置Kotlin Code Style
例如Kotlin:
fun main(args: Array<String>) {
// Desired comment
// After Using Ctrl+/
}
Run Code Online (Sandbox Code Playgroud)
但适用于Java:
public class Sample {
public static void main(String[] args) {
// Works fine using Ctrl+/
}
}
Run Code Online (Sandbox Code Playgroud)
我正在使用 IntelliJ IDEA 2018.3 ,但我相信这在 IDEA 2018.2 中仍然可用。
在“设置”中,Editor-> Code Style-> Kotlin->Wrapping and Braces下Keep when reformatting,取消勾选Comment at first column。
更新:我发现这不是在编码时...而是在Code-> Reformat Code:-(
| 归档时间: |
|
| 查看次数: |
311 次 |
| 最近记录: |