Search code examples
scalavisual-studio-codebuildvisual-studio-debuggingscala-metals

Is there a way to manually provide the build target path to Metals in VSCode?


I am working with Scala in VS Code, but have the problem that I can not get the debugger to run in some projects. Metals is simply not able to find the build target depending how the project is structured. Can I browse somehow in VS Code to the build target and "show" Metals where it is located ?


Solution

  • The easiest way to do this in a VS Code Metals Scala project is to browse to the level of the build.sbt and then run code . in bash. This will start the sbt compiler. Then you can open the command palette by hitting Control + P and type >Import Build. Once the import is completed, hit F5 to start debugging.