scalameta / metals

Scala language server with rich IDE features 🚀
https://scalameta.org/metals/
Apache License 2.0
2.04k stars 319 forks source link

"Run without debugging" in vscode starts the jvm in debugging mode #6239

Open kostaskougios opened 4 months ago

kostaskougios commented 4 months ago

Describe the bug

I've created a run config:

    {
      "type": "scala",
      "request": "launch",
      "name": "TroopsApp",
      "mainClass": "troops.troopsApp",
      "args": [],
      "env": {}
    }

When I try to run it with "Run without debugging" (ctrl-f5), the jvm starts in debugging mode.

Note: if I go to my main() class and click the "run" lense, it runs differently and not in debugging mode.

It may be a vscode behaviour, seems there is a lot of similar issues in other languages, https://www.google.com/search?client=firefox-b-d&q=vscode+%22run+without+debugging%22+always+starts+in+debugging+

Also seems tests run always in debugging mode. I've some scala tests that run a lot slower within vscode compared to running them from sbt.

Expected behavior

start the jvm without debugging

Operating system

macOS

Editor/Extension

VS Code

Version of Metals

v1.29

Extra context or search terms

No response

tgodzik commented 4 months ago

Thanks for reporting! Looks like we don't use the same mechanisms when running via launch.json. I was sure that was already fixed, but I need to actually take a look.