gpt4 book ai didi

scala - ENSIME 找不到正确的项目定义

转载 作者:行者123 更新时间:2023-12-02 02:13:48 25 4
gpt4 key购买 nike

我在带有 Scala 2.9.2 和 ensime_2.9.2-RC1-0.9.3.RC4 的 Ubuntu 12.04 上使用 Emacs 24 快照。

基本上我做了与 https://groups.google.com/forum/?hl=en&fromgroups#!topic/ensime/HvvvFr5gSwg 中描述的相同的事情

  • 我使用 sbt ensime generate 生成 .ensime 文件。
  • 我在 Emacs 上使用 M-x ensime 启动 ENSIME。
  • 它能正确解析所有库等(自动完成功能正常等)

但是,当我尝试使用 C-c C-v s 在 Emacs 中启动 SBT 控制台时,它显示以下错误:

[info] 从/home/ximyu/.sbt/plugins 加载项目定义

[info] 正在更新 {file:/home/ximyu/.sbt/plugins/}default-86f483...

[error] 模块未被授权依赖于自身:default#default-86f483;0.0

[错误] {file:/home/ximyu/.sbt/plugins/}default-86f483/*:update:java.lang.IllegalArgumentException:模块未被授权依赖于自身:default#default-86f483;0.0

显然 ENSIME 正在寻找错误的项目定义目录。它不是查看我的项目目录,而是查看 ~/.sbt。有什么解决办法吗?

最佳答案

我也有同样的问题。我刚开始使用ensime,所以我也不知道为什么会这样。另外,我对 scala 和 ensime 的了解非常有限,所以这只是解决一些可能更明显的问题的方法。

无论如何,这是有问题的 ensime 函数:

(defun ensime-sbt-project-dir-p (path)
"Is path an sbt project?"
(or (not (null (directory-files path nil "\\.sbt$")))
(file-exists-p (concat path "/project/Build.scala" ))
(file-exists-p (concat path "/project/boot" ))
(file-exists-p (concat path "/project/build.properties" ))))

基本上 ensime 将使用上面的函数来搜索缓冲区上方的文件夹,您可以在其中按 C-c C-v s 来确定根项目文件夹。因此,简单的修复是简单地添加一个(空).sbt 文件夹到包含您的 .ensime 项目描述的文件夹中。

关于scala - ENSIME 找不到正确的项目定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11547122/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com