来自IDEA的SBT消息来源 [英] SBT sources in IDEA

查看:377
本文介绍了来自IDEA的SBT消息来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目文件夹中使用 *。scala 文件来配置我的SBT项目。我正在使用IDEA12和Scala插件以及 sbt-idea 来生成项目。在SBT shell中调用 gen-idea 后,一切正常,除了一件事。当我在项目代码中的某些方法上单击转到声明时,IDEA会向我展示它是如何实现的(将我重定向到库源)。但是当我试图检查SBT的内部资源时,它会向我显示如下:

I'm using *.scala files in the project folder for configuring my SBT project. I'm using IDEA12 with the Scala Plugin and sbt-idea for generating the project. After calling gen-idea in the SBT shell, everything works fine except for one thing. When I click go to declaration on some method in my project code, IDEA shows me how it is implemented (redirects me to the library sources). But when I'm trying to "inspect" SBT's internal sources it shows me something like this:

def设置:Seq [设置[_] ] = {/ **编译代码** /}

如何将SBT源附加到我的IDEA项目?

How can I attach SBT sources to my IDEA project?

我正在使用SBT 0.12.3

推荐答案

在SBT中有两个命令可能会让您感兴趣:

In SBT there are two command which may interest you:

update-classifiers - 将下载项目中所有库的所有资源和文档

update-sbt-classifiers - 下载sbt源和文档

update-classifiers - will download all sources and documentation for all libs in your project
update-sbt-classifiers - downloads sbt sources and docs

这将下载您需要的所有资源。要与他们一起制作IDEA项目,只需拨打 gen-idea sbt-classifiers

This will download all the sources you need. To make an IDEA project with them just call gen-idea sbt-classifiers.

如果你不想要每次调用此命令重新生成项目时,您应该向 build.sbt 添加类似的内容: addCommandAlias(make-idea,; update-分类器; update-sbt-classifiers; gen-idea sbt-classifiers)

If you don't want to call each time this commands for re-generating you project, you should add something like this to your build.sbt: addCommandAlias("make-idea", ";update-classifiers; update-sbt-classifiers; gen-idea sbt-classifiers").

这篇关于来自IDEA的SBT消息来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆