java - Intellij IDEA Kotlin - 如何在同一列中发表评论?
问题描述
我希望在使用时有注释Ctrl+/
,它适用于代码Java
但不适用于 Kotlin
代码,我已经按照帮助台中的说明完成了(注意:我正在使用Intellij Ultimate 2018.2
)
要在 Java 中配置注释行为的设置,请使用注释代码部分中的选项,位于文件 | 中的代码生成选项卡上。设置/首选项 | 编辑 | 代码风格 | 爪哇。
标记Add a space at comment start
在Commented Code
部分,我在里面找不到任何注释代码配置Kotlin Code Style
例如在Kotlin
:
fun main(args: Array<String>) {
// Desired comment
// After Using Ctrl+/
}
但适用于Java
:
public class Sample {
public static void main(String[] args) {
// Works fine using Ctrl+/
}
}
解决方案
在Wrapping and Braces
使用键盘快捷键时此选项对我不起作用,设置如下:
Editor -> Code Style -> Kotlin -> Code Generation
并取消勾选选项:Line comment at first column
,完成!
推荐阅读
- firebase - 使用 Arduino 发送 Firebase 消息时出错
- delphi - Delphi IBX异常处理中的Firebird 3.x错误“尝试执行未准备好的动态SQL语句”?
- java - 识别来电者android并在toast中显示
- c - 如何在while循环中找到最大值和最小值 - c
- java - 使用两个线程读取文件时抛出 java.nio.BufferOverflowException
- github - 阻止 GitHub 将我的 Windows 1252 .txt 文件转换为 UTF-8
- php - 在 WordPress 中显示特定类别的帖子
- java - Spring不正确的Hibernate liquibase映射
- apache - 如何向 Apache 项目报告明显的错误?
- php - 帖子应该在数组中的类别下,MYSQL JOIN