关于如何让Intellij Scala插件在断点处停止的提示
下面微小的scala脚本的屏幕截图显示了设置的四个断点关于如何让Intellij Scala插件在断点处停止的提示,scala,intellij-idea,breakpoints,Scala,Intellij Idea,Breakpoints,下面微小的scala脚本的屏幕截图显示了设置的四个断点 object WC { val code = """import org.apache.hadoop.conf.Configuration // This class performs the map operation, translating raw input into the key-value class TokenizerMapper extends Mapper[Object,Text,Text,IntWritable]
object WC {
val code = """import org.apache.hadoop.conf.Configuration
// This class performs the map operation, translating raw input into the key-value
class TokenizerMapper extends Mapper[Object,Text,Text,IntWritable] {
"""
def sloc(str: String): Int = {
val x: List[String] = str.split("\\n").map(_.trim).toList.filter { line =>
line.length!=0 && !line.startsWith("import ") && !line.startsWith("/*") && !line.startsWith("//") && !line.equals("{") && !line.equals("}") }
println(x.mkString("\n"))
x.size
}
}
println (WC.sloc(WC.code))
以下是特点:
- 实际上,只有“println(WC.sloc(WC.code))”上的最后一个断点才得到尊重。其他的都被忽略了
- 但是,我可以在调试器中单步执行其他三行
我正在使用最新的IJ ULtimate 12.1.6。为了使调试器能够正常工作,IJ需要一个可用的类,而不仅仅是对象。这可能在第13条中得到了修正