VS代码 /金属:如何使用远程调试器调试Scala SBT项目?
我知道之前已经提出过一个问题在这里,但我根本无法弄清楚如何在VS代码(WSL)中调试我的Scala SBT项目。有人可以提供有关如何做到这一点的详细说明吗?使用(Java)远程调试器调试意味着什么?
当我经营金属医生时,它说它甚至无法检测到构建工具。但是,从终端中,我可以很好地运行/编译代码(fe说SBT“ testOnly *intestionTaskTasktest”)。
我添加了以下启动。输入debug之后:选择并开始在命令pallette中进行调试:
"version": "0.2.0",
"configurations": [
{
"type": "scala",
"request": "launch",
"name": "somename",
"mainClass": "somepackage.SparkMain",
"args": [],
"jvmOptions": []
}
但是我收到class:sompackage.sparkmain找不到
>
I know the question has been asked before in some variation here, but I simply can not figure out how to debug my scala sbt project in VS Code (WSL). Can someone provide some detailed instruction on how to do that ? What does it mean to debug using (java) remote Debugger ?
When I run Metals doctor, it says that it can not even detect the build tool. From the terminal however I am able to run/compile the code just fine (F.e. saying sbt "testOnly *IngestionTaskTest").
I addded the following launch.json file after entering >Debug: Select and Start Debugging in command Pallette:
"version": "0.2.0",
"configurations": [
{
"type": "scala",
"request": "launch",
"name": "somename",
"mainClass": "somepackage.SparkMain",
"args": [],
"jvmOptions": []
}
But I receive Class: sompackage.SparkMain not found
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我发现了如何做。这些是确切的步骤:
1。)配置启动。首先转到命令pallette并说> debug:选择并开始在命令pallette 2中进行调试
2)然后编辑启动。json看起来像这样:
4。)启用build.sbt中的sbt debugger,通过添加以下行:
> test/javaoptions +=“ -agentlib:jdwp = transport = dt_socket,server = y,suppend = n,dorkes = 8000”
5.)在bash终端中说sbt spest test/testonly tesonly thetest
6)秒直到项目&设置已加载。然后按Putton F5
(测试是指我的单位测试)。希望它有帮助。
Ok I found out how to do it. These are the exact steps:
1.) Configure launch.json manually. First go to command pallette and say >Debug: Select and Start Debugging in command Pallette
2.) Then edit launch.json to look like this:
4.) Enable sbt debugger in build.sbt by adding the following line:
Test / javaOptions += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"
5.) In the bash terminal say sbt Test/testOnly theTest
6.) Wait a few seconds until project & settings are loaded. Then press putton F5
(Tests refers to my unit tests). Hope it helps.