scalameta / nvim-metals

A Metals plugin for Neovim
https://scalameta.org/metals/
Apache License 2.0
455 stars 74 forks source link

`test case` code lens runs all the tests #659

Open Heikmike opened 3 months ago

Heikmike commented 3 months ago

Bug description

The test case code lens runs all the tests instead of the specific one. Same for debug test case.

Reproduction steps

  1. Create a new project with sbt new scala/scala3.g8
  2. Build the project and wait for the code lenses to appear
  3. Add a new test to src/test/scala/MySuite.scala to have two tests (to see that indeed several tests run instead of just one)
  4. Run the test case code lens of one of the two tests

Dap configuration

local dap = require("dap")

dap.configurations.scala = {
  {
    type = "scala",
    request = "launch",
    name = "RunOrTest",
    metals = {
      runType = "runOrTestFile",
      --args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example
    },
  },
}

Expected behavior

Only have the test related test case code lens to run.

Operating system

Linux

Version of Metals

1.2.2

Commit of nvim-metals

4f9bf0c