Clarify the role of bloop vs. sbt #3562
-
There's no document that seems to explain the "perfect metals setup" (for vscode). I end up simultaneously running Metals + Bloop, which is the default along with a terminal session that runs sbt. Latter is needed because:
Both bloop and sbt to take up quite a bit of memory over time- bloop even more so. Thus if there's a way to just run one thing "properly" then I'll do that. Should we:
I can understand running sbt for tasks Metals absolutely cannot do. But more often than not I don't need both to be running and would like to have one setup running as smoothly as possible. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 14 replies
-
Thanks for the question @vishalovercome! I see there are multiple conversations going on in issues and dicussions about parts of your question, so I'll focus on the sbt/bloop role to hopefully clarify a bit. Much of this is developer preference, but there are slight differences that might allow for one to work better than another. Overall, keep in mind that the level of Java/Scala support you're looking for probably won't be achieved outside of IntelliJ.
If you are using sbt heavily for testing and even have it open, then I'd probably just recommend using sbt as your build server. This can be achieved by the "Switch Build Server" command as long as you're using sbt > 1.4.1. Regarding spurious errors, I have no idea what that means without an example If you're referring to the ones related to junit 5 tests in Java, then you got your answer in the other thread.
Both Bloop and sbt are both utilizing https://github.com/scalacenter/scala-debug-adapter so the support should be the same there. |
Beta Was this translation helpful? Give feedback.
-
Switching to sbt has resulted in a strange error in a Java source file:
This code compiles cleanly under sbt but even after multiple "clean compilations" it doesn't seem to go away. Among other things it means that commands in launch.json won't work. I have tried re-importing the build and neither this issue nor the one about adding compiler flags will go away. Please let me know what bits of information will help you solve this |
Beta Was this translation helpful? Give feedback.
-
I decide to kill all java processes and vscode before I got to your message and strangely enough.. issue has gone. Now I hit one more issue after switching to sbt and running my application using launch.json. Note that absolutely no code or configuration has changed. I just switched to BSP and got this exception in the sbt session:
and this exception in metals.log
It doesn't look like sbt and bloop are interchangeable. |
Beta Was this translation helpful? Give feedback.
-
Ran into one more issue when switching from bloop to sbt. It seems running applications works just fine with bloop but sbt seems to have issues with dependencies that are marked as "Provided". How can we make it work with sbt as well? I can take a stab at adding all of the steps discussed in this thread to the Metals documentation if it helps |
Beta Was this translation helpful? Give feedback.
Thanks for the question @vishalovercome! I see there are multiple conversations going on in issues and dicussions about parts of your question, so I'll focus on the sbt/bloop role to hopefully clarify a bit.
Much of this is developer preference, but there are slight differences that might allow for one to work better than another. Overall, keep in mind that the level of Java/Scala support you're looking for probably won't be achieved outside of IntelliJ.