Configure Sublime Text build system for Scala?

ぃ、小莉子 提交于 2019-12-04 07:39:47

The answer that worked turned out to be very close to the second answer - apparently I'm not supposed to open up a new shell. If someone can clarify when to set "shell": true in the comments, that would be really helpful.

{
    "cmd": ["/path/to/bin/scala", "$file_name"],
    "working_dir": "${project_path:${folder}}",
    "selector": "source.scala"
}

In Packages/Scala/Scala.sublime-build, add this:

{
    "cmd": ["[PATH TO SCALA]", "$file"],
    "working_dir": "${project_path:${folder}}",
    "selector": "source.scala"
}

Replace the [PATH TO SCALA] with the path of where scala interpreter is located in your system. Do a "which scala" to find out.

This works for me:

{
    "cmd": ["scala", "$file"],
    "working_dir": "${project_path:${folder}}",
    "selector": "source.scala",
    "shell": true
}

given you set the system PATH thing:

Variable: %PATH%
Value: C:\Program Files (x86)\scala\bin
{
    "cmd": ["C:/Program Files (x86)/scala/bin/scala.bat", "$file_name"],
    "working_dir": "${project_path:${folder}}",
    "selector": "source.scala"
}

This worked for me. replace C:/ with your own path.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!