Java IntelliJIDEA for Scala 中的字节码反编译器

Java bytecode decompiler in IntelliJIDEA for Scala

我正在使用 IntellijIDEA 终极版。浏览从 java 源代码编译的 .class 文件很容易:我只需双击 .class 文件,IDEA 就会反编译它。

但是,对于从 scala 源代码编译的 .class 文件,它不起作用。似乎 IDEA 只是引用了 scala 源文件。

我注意到只有在安装了 scala plugin 的情况下,IDEA 才会表现得像那样。没有它它工作正常。有没有办法在不关闭的情况下使用IDEA进行反编译scala plugin?

这个功能终于在 Intellij 中发布了。

来自official website

You can decompile your Scala code to Java to see how a certain piece of code is translated and implemented in Java.

  1. In the Project tool window, right-click a Scala class that you want to decompile.
  2. From the context menu, select Decompile Scala to Java.

IntelliJ IDEA converts code to Java and opens the converted file in the editor.

You can also open a Scala class in the editor and use its context menu for the conversion.