scalameta / metals

Scala language server with rich IDE features 🚀
https://scalameta.org/metals/
Apache License 2.0
2.1k stars 332 forks source link

Failing import of project with `sbt` top-level directory #6748

Closed susliko closed 1 month ago

susliko commented 2 months ago

Describe the bug

This bug is kind of fun.

https://github.com/JetBrains/intellij-scala has sbt/ top-level directory. Trying to import build from Metals results in the following error in logs:

2024.09.03 13:38:33 ERROR Running process '/home/.../intellij-scala/sbt -Dbloop.export-jar-classifiers=sources bloopInstall' failed
java.io.IOException: Cannot run program "/home/.../intellij-scala/sbt" (in directory "/home/.../intellij-scala"): error=13, Permission denied

Metals tries to run this sbt directory instead of running actual sbt binary.

Expected behavior

Scala project imports regardles of top-level sbt file/directory.

Operating system

Linux

Editor/Extension

Nvim (nvim-metals)

Version of Metals

v1.3.5

Extra context or search terms

No response

tgodzik commented 2 months ago

Thanks for reporting! Do you have anything set in metals.sbtScript ? We usually just run a Java process without anything set.

tgodzik commented 2 months ago

Ach, actually I found the issue.