scala 如何在 Intellij 中打开 SBT 工具窗口?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32374193/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 07:33:17  来源:igfitidea点击:

How to open SBT Tool Window in Intellij?

scalaintellij-ideasbt

提问by DorianOlympia

This question may sound silly for you, but I have been searching the Internet for a while and couldn't find the answer. How can I open SBT Tool Window in Intellij (scala and SBT plugins obviously installed)?

这个问题对你来说可能听起来很傻,但我已经在互联网上搜索了一段时间,找不到答案。如何在 Intellij 中打开 SBT 工具窗口(明显安装了 Scala 和 SBT 插件)?

回答by Sascha Kolberg

In Menu: View -> Tool Windowsthere should be two entries:

在菜单中:View -> Tool Windows应该有两个条目:

  1. SBT
  2. SBT Console
  1. SBT
  2. SBT控制台

The first you can use to refresh IDEA project structure from SBT and view dependencies.

您可以使用第一个从 SBT 刷新 IDEA 项目结构并查看依赖项。

The second gives you a console where you can run sbtcommands.

第二个为您提供了一个控制台,您可以在其中运行sbt命令。

Update:

更新:

As Justin already aded:

正如贾斯汀已经补充的那样:

As of IntelliJ IDEA 2017.1 Build #IC-171.3780.52there is a new and (imho) better way:

IntelliJ IDEA 2017.1 Build #IC-171.3780.52 开始,有一种新的(恕我直言)更好的方法:

(If you are working with an SBT project, that is)

(如果您正在使用 SBT 项目,那就是)

When you open the SBT Tool Window, you will find a new scala terminalicon:

当您打开SBT 工具窗口时,您会发现一个新的Scala 终端图标:

enter image description here

在此处输入图片说明



This will open an sbt console session with your sbt project import settings.

这将使用您的 sbt 项目导入设置打开 sbt 控制台会话。

One major benefit is that you will actually (finally) get links to your code lines for compiler warnings and errors.

一个主要的好处是您实际上(最终)会获得指向编译器警告和错误的代码行的链接。

回答by R?zvan Flavius Panda

To be able to open SBT Consolefrom View-> Tool Windowsyou first need to install the plugin required for it.

为了能够打开SBT ConsoleView- >Tool Windows您首先需要安装它所需的插件。

You can find the SBT plugin by searching for it under Settings-> Plugins-> Browse repositories

您可以通过在Settings-> Plugins->下搜索来找到 SBT 插件Browse repositories

Plugin homepage: https://github.com/orfHymanal/idea-sbt-plugin

插件主页:https: //github.com/orfHymanal/idea-sbt-plugin

回答by Justin Kaeser

In IntelliJ 2017.1, an sbt shell is integrated with the Scala plugin. You can open it from an icon on the sbt project view toolwindow, or from the "Tools" menu enter image description here

IntelliJ 2017.1 中,sbt shell 与 Scala 插件集成。您可以从 sbt 项目视图工具窗口上的图标或从“工具”菜单中打开它 在此处输入图片说明

回答by Marek Dudek

In Intellij 16SBT Consolemenu item no longer exists and in Debian 7(XFCE) Alt-F12doesn't work.

Intellij 16 SBT 控制台菜单项不再存在并且在Debian 7( XFCE)Alt-F12中不起作用。

To run SBTconsole:

运行SBT控制台:

  1. select View-> Tool Windows-> Terminal(for Alt-F12)
  2. type sbtand console works
  1. 选择View-> Tool Windows-> Terminal(为Alt-F12
  2. 类型sbt和控制台工作

回答by Prasad

You can either use above or simply use Alt+F12

您可以使用上面的或简单地使用 Alt+F12