Closed abhijeetsrivastava closed 3 years ago
I will try to fix it, for now, I am struggling to make it work even in vscode. I asked for help metals gitter.
Before I come up with the full fix, that should work:(after replacing the values I have hardcoded).
(with-current-buffer "Hello.scala"
(-let (((&DebugSession :name :uri)
(lsp-send-execute-command
"debug-adapter-start"
'(:targets [(:uri "file:/home/yyoncho/Sources/Scala/hello/?id=root")]
:dataKind "scala-attach-remote"
:data (:type "scala" :request "attach" :name "Untitled" :hostName "localhost" :port 5005)))))
(dap-debug
(list :debugServer (-> uri
(split-string ":")
cl-third
string-to-number)
:type "scala"
:name name
:buildTarget "run"
:port 5005
:hostName "localhost"
:host "localhost"
:request "attach"))))
PR at #51
Describe the bug Scala in emacs can be debugged via -java-debug option.
Using codelens we can debug a Runnable scala file.
I have a sbt project, where I run sbt -java-debug 1234. From Intellij I can connect to this remote debugger easily. I am unable to attach to this debugger via emacs.
To Reproduce run
sbt new playframework/play-scala-seed.g8
start remote debugger
sbt -java-debug 1234
(might have to change the port`.Next step (which is missing). - attach the remote debugger to emacs.
Expected behavior I would like to use remote debugger via emacs. This entire process is supported by metals. I have successfully attached this in intellij.