Questions tagged [scala-metals]

Scala language server with rich IDE features

Metals

Scala language server with rich IDE features

See: https://scalameta.org/metals/

46 questions
14
votes
1 answer

Making sense of Scala development tools

There is a myriad of development tools and terms in the ecosystem, for example, language server, build server, Metals, BSP, LSP, Bloop, Zinc, Coursier, incremental compiler, presentation compiler, etc. I was wondering if someone could demonstrate…
11
votes
3 answers

How exactly do I use Metals and VS Code Debugger?

Metals announced that "It is now possible to run and test directly from VS Code using the new "Run", "Test", "Debug" and "Debug test" buttons." There is a nice gif showing what it can do, and I don't know how to get to that point. I tried to launch…
vivian
  • 732
  • 1
  • 6
  • 18
11
votes
1 answer

How to set breakpoints in vs code in a scala program

I want to debug my scala app with vscode. My gradle run task looks as simple: task run(type: JavaExec, dependsOn: build) { debug true main = mainClassFile classpath sourceSets.main.runtimeClasspath classpath…
Matthias
  • 1,055
  • 2
  • 14
  • 26
10
votes
1 answer

VSCode metals, run specific ten in scalatest

is there a way in vscode with metals scala plugin, run specific test scenario ? Like in IntelliJ ?
FrancMo
  • 2,459
  • 2
  • 19
  • 39
7
votes
2 answers

Using vs code, how to get scala format to work and format my code?

I have the scala format plugin in my multi project sbt repository. addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.2") So in the sbt console if I run scalafmt it works fine My build.sbt has: scalafmtOnCompile := true If I do a…
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
7
votes
0 answers

Remote Debugging Scala Spark Jobs with VsCode

I'd like to have the ability to remote debug a Spark job written in Scala running in a docker container with VsCode. This is what I have so far, VsCode with scala-metals v0.8 installed This debug launch configuration I spin up a spark cluster with…
5
votes
2 answers

Downloading Metals (Vscode Scala extension) failed with the following: spawn C:\Program Files (x86)\Java\jdk1.8.0_144\bin\bin\java ENOENT

I'm trying to run a Scala program on the vscode. I tried downloading Scala (Metals) Extension but it gives me the following error. Failed to download Metals, make sure you have an internet connection and the Java Home 'C:\Program Files…
5
votes
1 answer

Scala VSCode, metals intellisense not working correctly

This code does compile and run with mill, but intellisense shows error "object pwd is not a member of package foo.os bloop" //main.scala package foo object Exercise{ def main(args: Array[String]): Unit = { println(os.pwd) …
usermine12
  • 77
  • 1
  • 7
5
votes
1 answer

VS Code knows Scala and Java, but can't connect them

I am trying to interoperate Scala with Java, and have managed to create a Maven based project (repository here) that compiles fine from commandline (mvn clean package). However, I keep running into the issue that my IDE (VS Code) doesn't understand…
Sonke W
  • 107
  • 6
4
votes
2 answers

How to run an existing Scala project using VS Code and Metals?

I am brand new to Scala and I find that Scala IDE is very slow on my machine for basic things like searching the codebase and editing code. I am used to Visual Studio Code and was very happy to find this metals extension. I was able to "import…
pradhyo
  • 157
  • 1
  • 2
  • 19
3
votes
0 answers

How do I use sbt from a Github Codespace terminal where Scala was installed by Metals?

I am new to Scala development and would like to keep it entirely in the cloud. I am looking for the easiest way to get a fully functional workspace in a Github Codespace, including the Metals extension/language server, but also be able to use scala…
3
votes
1 answer

Metals extension download failed

I'm trying to install metals for VS Code, it worked fine for me in the past. However now when trying, I get thee following error message: Failed to download Metals, make sure you have an internet connection, the Metals version '0.11.6' is correct…
3
votes
2 answers

Error downloading org.scalameta:semanticdb-scalac_2.13.6:4.4.10

I recently upgraded to Scala 2.13.6 and I am seeing: Error downloading org.scalameta:semanticdb-scalac_2.13.6:4.4.10 when I try to build. I had a similar error when I upgraded to 2.13.5, but was able to add semanticdbVersion := "4.4.11" to…
Sully
  • 494
  • 1
  • 5
  • 12
3
votes
1 answer

Dealing with recursive dependencies in Scala Metals language server with bloop

I've been using coc.nvim for a bit and really loving it. Recently I've started working on a relatively large project consisting mostly of Scala code and so installed the coc-metals extension, which automatically installs the language server and…
sc8ing
  • 369
  • 1
  • 3
  • 9
3
votes
1 answer

Sbt run tests from src/main/scala instead of src/test/scala?

Say I have a scalatest class in main/scala, like import org.scalatest.FunSuite class q3 extends FunSuite { test("6 5 4 3 2 1") { val digits = Array(6,5,4,3,2,1) assert(digits.sorted === Array(1,2,3,4,5,6)) } } How do I run…
Noam Eyal
  • 318
  • 2
  • 7
1
2 3 4