-
Hello, I was trying to run metals on a sample script (.sc file) whose directory was set in this way: scala-cli setup-ide . --dep com.lihaoyi::os-lib:0.9.0 And I discovered that metals couldn't find the dependency library, I gave a peek into the code and I realized metals only writes .bsp data. The workaround was to inject the dependency via directive. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Thanks for the question, Metals does use My workflow was:
and then everything worked fine in Metals. Although I would suggest using directives for dependencies since you wouldn't need to add the dependency in the terminal each time. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the explanation! You are right, the example works fine. I got mislead by an incorrect setup of my editor settings (I use Emacs and my lsp-mode workspace was pointing to the parent directory instead of the directory with the .scala-build settings and so metals couldn't find the dependencies). Great news! |
Beta Was this translation helpful? Give feedback.
Thanks for the question, Metals does use
.bsp
but the dependency is not contained there. Those are available for Metals in .scala-build directory. Trying out your examples doesn't cause any issues. os-lib is available within Metals and can run there.My workflow was:
and then everything worked fine in Metals.
Although I would suggest using directives for dependencies since you wouldn't need to add the dependency in the terminal each time.