Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

re enable intellij java to kotlin conversion

I disabled the intellij dialog asking for converting Java code to Kotlin code on copy paste code from Java to Kotlin thinking that it would always convert without asking, but now it never converts. How can I enable this dialog again? I couldn't find any way to do it and now the IDE is not converting Java to Kotlin on copy + paste anymore.

like image 518
Erik Avatar asked Nov 21 '17 19:11

Erik


People also ask

Can IntelliJ convert Java to Kotlin?

Convert Java Code to Kotlin Code But, if you like to convert your Java code to Kotlin code, you may do so. To migrate from Java to Kotlin, Kotlin Official is providing tools via online, which is using official Kotlin site, or offline, which is using IntelliJ IDEA integrated development environment.

How do I change my Java code to Kotlin?

To convert Java code to Kotlin, open the Java file in Android Studio, and select Code > Convert Java File to Kotlin File. Alternatively, create a new Kotlin file (File > New > Kotlin File/Class), and then paste your Java code into that file.

Can you use both Kotlin and Java in the same project?

If your question is can you use kotlin files in java files and vice versa then the answer is yes.


1 Answers

Open preferences (Windows = Ctrl-Alt-S, Mac = Cmd-,).

Go to Editor -> General -> Smart Keys and scroll to the bottom.

The Convert pasted Java code to Kotlin and Don't show Java to Kotlin conversion dialog during paste options should be in the Kotlin section

like image 119
Todd Avatar answered Oct 21 '22 21:10

Todd