Intellij IDEA Kotlin - 如何在同一栏中发表评论?

Den*_*ash 8 java comments intellij-idea kotlin

我要评论使用时,可以预期Ctrl+/,它的工作原理Java ,但不是 Kotlin代码,如提及我已经做了帮助台(注:我使用Intellij Ultimate 2018.2)

要在Java中配置注释行为的设置,请使用位于"文件"|"代码生成"选项卡上的"注释代码"部分中的选项 设置/首选项| 编辑| 代码风格| Java的.

标记Add a space at comment startCommented 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)

Gen*_*hen 1

我正在使用 IntelliJ IDEA 2018.3 但我相信这在 IDEA 2018.2 中仍然可用。

在“设置”中,Editor-> Code Style-> Kotlin->Wrapping and BracesKeep when reformatting取消勾选Comment at first column

第一列的评论已关闭,示例显示了我们的预期。

更新:我发现这不是在编码时...而是在Code-> Reformat Code:-(