emacs-lsp / lsp-metals

lsp-mode :heart: metals
https://emacs-lsp.github.io/lsp-metals
GNU General Public License v3.0
58 stars 33 forks source link

Documentation request: how to add a DAP-configuration for Scala? #29

Closed endrebak closed 3 years ago

endrebak commented 3 years ago

Hi and thanks for this package.

My problem is that I cannot get the debugger to work with this package. I have tried with both spacemacs and doom, but every time I try to start the debugger (M-x dap-debug) it asks me for a configuration template. Do you have a suggested template for Scala (like the ones found at https://emacs-lsp.github.io/dap-mode/page/configuration/)?

endrebak commented 3 years ago

Got it working. This wasn't relevant. Sorry.

snippins commented 3 years ago

@endrebak I couldn't figure it out myself, how did you do it?

endrebak commented 3 years ago

Create an object that extends App. Then a run|debug lens should show above the object definition. This wasn’t/isn’t documented anywhere AFAICS. It is just magic.

Don’t remember what the rest of my settings were like. But I am using the Scala layer in Doom. And I followed the installation instructions for metals.

snippins commented 3 years ago

@endrebak I have already used the lens, but this doesn't cover the case where I need to pass arguments :((.

endrebak commented 3 years ago

Yeah, I might start to use IntelliJ when I need to debug stuff :/

On Wed, Jan 27, 2021 at 4:52 PM snippins notifications@github.com wrote:

@endrebak https://github.com/endrebak I have already used the lens, but this doesn't cover the case where I need to pass arguments :((.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/emacs-lsp/lsp-metals/issues/29#issuecomment-768381222, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEHURUQ3CSTBTEIF7RXQ3MTS4AZFDANCNFSM4SMWYETQ .

Camsbury commented 2 years ago

@yyoncho any thoughts on this? I saw you had a working example, but I'm not sure how to set this up for use in a project with a main that takes arguments...

yyoncho commented 2 years ago

You can pass args param. All options can be found here: https://github.com/scalameta/metals-vscode/blob/main/package.json#L680