Reputation: 53874
I want comments to be intended when using Ctrl+/
, it works for Java
but not for Kotlin
code, I have done as mentioned in help-desk (Note: I'm using Intellij Ultimate 2018.2
)
To configure settings for commenting behavior in Java, use options in the Comment Code section, on the Code Generation tab located in File | Settings/Preferences | Editor | Code Style | Java.
Marked Add a space at comment start
in Commented Code
section,
I couldn't find any comment code configuration in Kotlin Code Style
For example in Kotlin
:
fun main(args: Array<String>) {
// Desired comment
// After Using Ctrl+/
}
But works in Java
:
public class Sample {
public static void main(String[] args) {
// Works fine using Ctrl+/
}
}
Upvotes: 8
Views: 751
Reputation: 983
In Wrapping and Braces
this option is not working for me while use keyboard shortcut, the setting is under:
Editor -> Code Style -> Kotlin -> Code Generation
and untick the option: Line comment at first column
, done!
Upvotes: 1
Reputation: 5214
I'm using IntelliJ IDEA 2018.3, but I believe this is still available in IDEA 2018.2.
In Settings, Editor
-> Code Style
-> Kotlin
-> Wrapping and Braces
, under Keep when reformatting
, untick Comment at first column
.
Update: I found this is not at coding... But take place after Code
-> Reformat Code
:-(
Upvotes: 1