IDEA 中的 SBT 资源 [英] SBT sources in IDEA

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

问题描述

我正在使用 project 文件夹中的 *.scala 文件来配置我的 SBT 项目.我正在使用带有 Scala 插件的 IDEA12 和 sbt-idea 来生成项目.在 SBT shell 中调用 gen-idea 后,除了一件事,一切都正常.当我在项目代码中的某个方法上单击 go to declaration 时,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 settings: Seq[Setting[_]] = {/** 编译代码**/}

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

How can I attach SBT sources to my IDEA project?

我正在使用 SBT 0.12.3.

I'm using 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-classifiers;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天全站免登陆