brotzeit / rustic

Rust development environment for Emacs
Apache License 2.0
729 stars 102 forks source link

dap-mode integration #86

Open brotzeit opened 4 years ago

brotzeit commented 4 years ago

https://github.com/emacs-lsp/dap-mode/issues/6#issuecomment-468795513

holyfight6 commented 3 years ago

Hi @brotzeit , is there any progress of this enhancement? I'm very new to emacs lisp, so I doubt that I could do this myself. Is there any way I could help with this? BTW, is there any code style guide of this project?

brotzeit commented 3 years ago

is there any progress of this enhancement?

Unfortunately no(at least not for rustic).

Is there any way I could help with this?

I actually haven't spent time on investigating. @yyoncho mentioned the idea some time ago https://github.com/emacs-lsp/dap-mode/issues/6#issuecomment-468795513. Maybe somebody already did some work on it ? I haven't been using dap-mode for a long time.

BTW, is there any code style guide of this project?

Not really. Just the general elisp best practices.

yyoncho commented 3 years ago

lsp-mode should be now sufficient after installing cpptools adapter. Then M-x lsp-rust-analyzer-debug or clicking on the debug lens should do.

holyfight6 commented 3 years ago

@yyoncho thanks I will try that.

holyfight6 commented 3 years ago

@yyoncho Hi, when I tried to use M-x lsp-rust-analyzer-debug or the debug lens, I encountered this error: Warning (emacs): Initialize request failed: Unable to start debugging. Launch options string provided by the project system is invalid. Unable to determine path to debugger. Please specify the "MIDebuggerPath" option. But I didn't find any way to set this argument. I didn't find any code in lsp-rust-analyzer-debug set MIMode or MIDebuggerPath either.

yyoncho commented 3 years ago

@holyfight6 do you have lldb installed?

holyfight6 commented 3 years ago

@yyoncho Yes, I have lldb installed. But it seems the default debugger without setting MIMode is gdb and I don't have gdb installed.

yyoncho commented 3 years ago

can you try if adding MIMode in lsp-rust-analyzer-debug will fix the issue?

holyfight6 commented 3 years ago

I've tried this: (list :type "cppdbg" :request "launch" :name label :args executable-args :cwd workspace-root? :sourceLanguages ["rust"] :MIMode "lldb" :MIDebuggerPath "/usr/bin/lldb" :program) But get this error: error: unknown option: --interpreter=mi error: unknown option: --tty=/dev/pts/0 Use 'lldb --help' for a complete list of options. Edit: Without the MIDebuggerPath set, it will still complain Launch options string provided by the project system is invalid. Unable to determine path to debugger. Please specify the "MIDebuggerPath" option.

yyoncho commented 3 years ago

Can you open lsp-mode issue? I will take a look what is needed to make it work with lldb

holyfight6 commented 3 years ago

@yyoncho It's done. The issue is emacs-lsp/lsp-mode#2928. If you don't have much time, I can try to implement something similar to the rust-analyzer vscode extension, but I'm new to emacs lisp so it may take some time.