Java to Scala
Hi there,
how is the automatically-convert-java-to-scala Dialog triggered? Because I see it rarely when copying + pasting code from a .java file to .scala file. I'm converting a lot of files at the moment, so that functionality comes very handy, but often IDEA doesn't respond it just pastes the java code as-is into my .scala files. Any way to explicitly invoke the conversion?
Thanks!
.h.h.
Please sign in to leave a comment.
Ha! Shift+Cmd+V shows the paste-selection dialog ("Paste from history" -- shortcut not shown in the menu, I just intuitively hit it). After I choose things there, it starts again asking me that question :)
You can always tweak conversion settings in Project Settings / Scala / Other settings.
Additionally, you may convert Java files completely via Refactor / Convert Java file to Scala (Ctrl + Shift + G).
Hi,
Is there a way in IntelliJ to convert a folder or a project containing .java files into respective .scala files (with recursive capability)?
Assume that folder structure is:
- SourceFolder
- Folder 1
- abc.java
- abc.html
- Folder 2
- def.java
- def.html
We are trying to get an output as:
- DestinationFolder
- Folder 1
- abc.scala
- abc.html
- Folder 2
- def.scala
- def.html
Thank you.