Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Julia Debugger #134

Open
reachtarunhere opened this issue Aug 8, 2024 · 3 comments
Open

Support for Julia Debugger #134

reachtarunhere opened this issue Aug 8, 2024 · 3 comments

Comments

@reachtarunhere
Copy link

Hello I am trying to get Julia Debugger working with dape.

There has already been done with neovim so I assume it would be possible in emacs with dape

https://github.com/kdheepak/nvim-dap-julia/blob/main/lua/nvim-dap-julia.lua

Below is my experimental config that is not working

(setq dape-configs `((julia-debug
			  modes (julia-mode)
			  command "/home/tarun/.local/bin/julia"
			  port 9020
			  :type "server"
			  :request "launch"
			  :cwd dape-cwd-fn
			  :program dape-find-file-buffer-default
			  :args ["/home/tarun/Downloads/information/server.jl"])))

I get the error: Doing vform no such file or directory

I have tried running the server directly with the command and it does run. Any help would be appreciated! I am willing to try and report back on the suggestions

@svaante
Copy link
Owner

svaante commented Aug 17, 2024

There are some pain points/issues with DebugAdapter.jl currently:

  1. It does not follow the spec, it uses "success": "true" rather
    then "success": true in responses (see dape patch below).
  2. There are no "official" bin/script to launch the debug adapter with
    command line args, therefore I recommend using the nvim-dap-julia
    neovim plugin to package the launcher script server.jl.

I would rather see that DebugAdapter.jl follows the DAP protocol then merging the patch below.

Apply patch:

diff --git a/dape.el b/dape.el
index cda9d7e..8977c14 100644
--- a/dape.el
+++ b/dape.el
@@ -1369,7 +1369,9 @@ On failure, ERROR will be an string."
                          (when (functionp cb)
                            (lambda (result)
                              (funcall cb (plist-get result :body)
-                                      (unless (eq (plist-get result :success) t)
+                                      (unless (or (eq (plist-get result :success) t)
+                                                  (equal (plist-get result :success)
+                                                         "true"))
                                         (or (plist-get result :message) "")))))
                          :error-fn 'ignore ;; will never be called
                          :timeout-fn

Install bridge and DebugAdapter.jl:

mkdir -p ~/.emacs.d/debug-adapters
cd ~/.emacs.d/debug-adapters
git clone https://github.com/kdheepak/nvim-dap-julia
# install dependencies from nvim-dap-julia TOML

Add default config:

(add-to-list 'dape-configs
             `(julia command "julia"
                     command-args
                     (,(expand-file-name
                        (file-name-concat
                         dape-adapter-dir "nvim-dap-julia" "scripts" "server.jl"))
                      :autoport)
                     port :autoport
                     :type "julia"
                     :program dape-buffer-default
                     :stopOnEntry nil
                     :cwd dape-cwd
                     :args []
                     :juliaEnv dape-cwd
                     :exitAfterTaskReturns nil
                     :debugAutoInterpretAllModules nil))

@svaante
Copy link
Owner

svaante commented Aug 17, 2024

Added an issue for wrong response.success type.

julia-vscode/DebugAdapter.jl#87.

@svaante
Copy link
Owner

svaante commented Sep 11, 2024

Tracking julia-vscode/DebugAdapter.jl#93 for eas of integration, otherwise server script in https://github.com/kdheepak/nvim-dap-julia is an possibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants