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

Integrating Julia's Debug Adapter Protocol with neovim #59

Open
tapyu opened this issue Apr 20, 2022 · 6 comments · Fixed by #78
Open

Integrating Julia's Debug Adapter Protocol with neovim #59

tapyu opened this issue Apr 20, 2022 · 6 comments · Fixed by #78
Labels
enhancement New feature or request

Comments

@tapyu
Copy link

tapyu commented Apr 20, 2022

I am trying to integrate Julia's DAP with Debug Adapter Protocol client implementation for Neovim. You must to configure the DAP for each specific language. I've tried to do so using some references for other languages, but it failed...

I am not an expert with regard Debug Adapter Protocol and how to handle then, and the source for doing that with Julia are scarce. Anyone can give some help?

Thank you.

@davidanthoff davidanthoff added the enhancement New feature or request label Oct 15, 2022
@remann2
Copy link

remann2 commented Sep 19, 2023

Still hoping one day this will happen.

@davidanthoff
Copy link
Member

I just merged a PR that implements the actual DAP, not our own home-grown JSON-RPC version of it. So, in principle this should now be feasible. In practice I expect that the API for using things will see some churn in the next couple of weeks before things settle down a bit.

@kdheepak

This comment was marked as outdated.

@kdheepak
Copy link
Contributor

It turns out I had to pass a program to the configuration. Now I get a different error:


[debug-adapter stderr] ERROR: 
[debug-adapter stderr] MethodError: no method matching activate(::Missing)

Closest candidates are:
  activate(; temp, shared, prev, io)
   @ Pkg ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:1896
  activate(!Matched::Function, !Matched::AbstractString)
   @ Pkg ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:1976
  activate(!Matched::AbstractString; shared, temp, io)
   @ Pkg ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:1932

[debug-adapter stderr] 
Stacktrace:
[debug-adapter stderr] 
 [1] launch_request(debug_session::DebugAdapter.DebugSession, params::DebugAdapter.LaunchArguments)
   @ DebugAdapter ~/.julia/packages/DebugAdapter/NSeaJ/src/debugger_requests.jl:54
 [2] 
[debug-adapter stderr] (::DebugAdapter.var"#129#158"{DebugAdapter.DebugSession})(params::DebugAdapter.LaunchArguments)
[debug-adapter stderr] 
   @ DebugAdapter ~/.julia/packages/DebugAdapter/NSeaJ/src/packagedef.jl:99
 [3] 
[debug-adapter stderr] dispatch_msg(x::DebugAdapter.DAPRPC.DAPEndpoint{TCPSocket, TCPSocket}, dispatcher::DebugAdapter.DAPRPC.MsgDispatcher, msg::Dict{String, Any})
   @ DebugAdapter.DAPRPC ~/.julia/packages/DebugAdapter/NSeaJ/src/DAPRPC/typed.jl:89
 [4] (::DebugAdapter.var"#132#161"{Dict{String, Any}, Nothing, DebugAdapter.DAPRPC.MsgDispatcher, DebugAdapter.DAPRPC.DAPEndpoint{TCPSocket, TCPSocket}})()
   @ DebugAdapter
[debug-adapter stderr]  
[debug-adapter stderr] ~/.julia/packages/DebugAdapter/NSeaJ/src/packagedef.jl:105
[debug-adapter stderr] 

@kdheepak
Copy link
Contributor

I hardcoded juliaEnv into the requests with the current workspace and now I get this error:


[debug-adapter stderr]   Activating
[debug-adapter stderr]  project at `~/gitrepos/nvim-dap-julia`

[debug-adapter stderr] ERROR: 
[debug-adapter stderr] MethodError: Cannot `convert` an object of type Missing to an object of type Bool
[debug-adapter stderr] 

Closest candidates are:
  convert(::Type{T}, !Matched::T) where T<:Number
   @ Base number.jl:6
  convert(::Type{T}, !Matched::T) where T
   @ Base Base.jl:84
  convert(::Type{T}, !Matched::Number) where T<:Number
   @ Base number.jl:7
  ...

[debug-adapter stderr] 
Stacktrace:
[debug-adapter stderr] 
 [1] setproperty!(x::DebugAdapter.DebugSession, f::Symbol, v::Missing)
   @ Base ./Base.jl:40
 [2] launch_request(debug_session::DebugAdapter.DebugSession, params::DebugAdapter.LaunchArguments)
   @ DebugAdapter 
[debug-adapter stderr] ~/.julia/packages/DebugAdapter/NSeaJ/src/
[debug-adapter stderr] debugger_requests.jl:104
[debug-adapter stderr] 

[debug-adapter stderr]  
[debug-adapter stderr] [3]
[debug-adapter stderr]  
[debug-adapter stderr] (::DebugAdapter.var"#129#158"{DebugAdapter.DebugSession})(params::DebugAdapter.LaunchArguments)
[debug-adapter stderr] 
   @ DebugAdapter ~/.julia/packages/DebugAdapter/NSeaJ/src/packagedef.jl:99
 [4] dispatch_msg(x::DebugAdapter.DAPRPC.DAPEndpoint{TCPSocket, TCPSocket}, dispatcher::DebugAdapter.DAPRPC.MsgDispatcher, msg::Dict{String, Any})
   @ DebugAdapter.DAPRPC
[debug-adapter stderr]  ~/.julia/packages/DebugAdapter/NSeaJ/src/DAPRPC/typed.jl:89
 [5] (::DebugAdapter.var"#132#161"{Dict{String, Any}, Nothing, DebugAdapter.DAPRPC.MsgDispatcher, DebugAdapter.DAPRPC.DAPEndpoint{TCPSocket, TCPSocket}})()
   @ DebugAdapter ~/.julia/packages/DebugAdapter/NSeaJ/src/packagedef.jl:105

@kdheepak
Copy link
Contributor

kdheepak commented Jun 29, 2024

I set stopOnEntry = true and now I have a version that works with neovim:

nvim-dap-julia.mov

I made the repo public: https://github.com/kdheepak/nvim-dap-julia

It segfaults when it finishes running the server but otherwise seems to work. I haven't tested a lot of features yet.

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

Successfully merging a pull request may close this issue.

4 participants